?????????????????????
??????????????????SQLite????????????????????????????????????????????????????????????datatable?????????????д???????...??????????EF????
??????????????????EF???????????????app.config????web.config??д??connectionstring???????????????????????????????????????????????????????????鷳??д???????????
????????????????????DbContext????????????
public MyDbContext ()
:base("ConnectionStringorName")
{
}
????????????????????????????????config?????name??
????P.S. ???????????????????????????????name??????????????????"name=myconn"
???????name???????????????????????????provider??????????????????????SQL EXPRESS??????????????????????????????????д???????
??????????????????Database.Connection??????????????????巽?????£?
public MyDbContext(string connection)
{
Database.Connection.ConnectionString = GetSqliteString(connection);
}
????????????base??????????????mysqlite??getsqlitestring???£?
private string GetSqliteString(string connect)
{
return "Data Source=" + connect;
}
?????????????connectionstring????????????????????·?????????
?????????????????????????????????????????????????????????????