vs2010访问数据库,返回值为null?代码错哪里了?如题 谢谢了
stringstrConnection="Provider=Microsoft.ACE.OLEDB.12.0;DataSource=|DataDirectory|note...
string strConnection = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|note.accdb;"; OleDbConnection objConnection = new OleDbConnection(strConnection); objConnection.Open(); OleDbCommand dc = new OleDbCommand("SELECT * FROM note11 ", objConnection); content1.Value = dc.ExecuteScalar().ToString(); objConnection.Close();
展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询