c#语言,连接一个access数据库语句如下,为什么出现错误呢?跪求解释。。。
stringstrConnection="provider=Microsoft.jet.OLEDB.4.0;";strConnection+="DataSource=";...
string strConnection = "provider=Microsoft.jet.OLEDB.4.0;";
strConnection += "Data Source=";
strConnection += mappath("DATA.mdb");
上下文不存在mappath! 展开
strConnection += "Data Source=";
strConnection += mappath("DATA.mdb");
上下文不存在mappath! 展开
3个回答
展开全部
string strCon = "provider=microsoft.jet.oledb.4.0;";
strCon += @"data source=d:\DATA.mde";
OleDbConnection conn = new OleDbConnection(strCon);
conn.Open();
OleDbDataAdapter da = new OleDbDataAdapter("select * from 表", conn);
DataSet ds = new DataSet();
da.Fill(ds);
strCon += @"data source=d:\DATA.mde";
OleDbConnection conn = new OleDbConnection(strCon);
conn.Open();
OleDbDataAdapter da = new OleDbDataAdapter("select * from 表", conn);
DataSet ds = new DataSet();
da.Fill(ds);
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询