I have been writing a Data library to hide Odbc, Ole,Sql, Oracle etc
from the user and have been using the Idb interface.
But there is no IDbCommandBuilder!Please help me, Thanks!
from the user and have been using the Idb interface.
But there is no IDbCommandBuilder!Please help me, Thanks!
How to do it? can you write it,thanks!
//Or OdbcDataAdapter/OracleDataAdapter
System.Data.Common.DbCommandBuilder cb = new System.Data.Common.DbCommandBuilder(da);Then the sql for deleting,inserting,updating are all ready for the DbDataAdapter.
i run it ,and the error message is:错误 7 无法创建抽象类或接口“System.Data.Common.DbCommandBuilder”的实例
DbCommandBuilder is an abstract class.Sorry!
should not use "OledbCommandBuilder"
http://hi.baidu.com/isloveok/blog/item/44dd4f2dddbaed37359bf77c.html
private static readonly string path = ConfigurationManager.AppSettings["commandbuilder"]; private DataAccess() { } public static DbCommandBuilder CreateCommandBuilder() {
string className = path + ".CommandBuilder";
return (DbCommandBuilder)Assembly.Load(path).CreateInstance(className);
}
}You should add such information to web.config or app.config.When you wanna alter you database, you
can only modify the config file. <appSettings>
<add key="commandbuilder" value="System.Data.Oledb.OledbCommandBuilder"/>
<appSettings>
I thought that I came to English BBS