数据库问题~~~~~~
public DB() {
strCon = @"Provider = Microsoft.Jet.OLEDB.4.0 ; Data Source = f:\tool\package\anforma_AU\pack_tool_zerogra_1.00_自动版\pack_tool\bin\Debug\config\database\database\AU_DB.mdb";
}
public void getDB() {
try {
if (sqlCon==null)
sqlCon = new OleDbConnection(strCon);
if (sqlCon.State != ConnectionState.Open)
sqlCon.Open(); /////////打开这个始终出错
ds = new DataSet();
string strCom = "select * from auTable";
sqlDA = new OleDbDataAdapter(strCom, sqlCon);
sqlDA.Fill(ds, "auTable");
sqlCon.Close();
BusinessEntity.DataSet = ds;
}
catch { }
}
------解决方案--------------------看一下数据库的用户名和密码是否正确~
------解决方案--------------------你应该要先连接一下数据库才能open吧
------解决方案--------------------参考:http://blog.csdn.net/gisfarmer/archive/2008/12/30/3648761.aspx
http://blog.csdn.net/gisfarmer/archive/2009/01/04/3701136.aspx