用oledb,数据库访问出错??
以下是我的代码:
tring str_ole = "select * from zs.dbf ";
string str_conn = "data source = F:\\Solution\\Dbf库;provider = vfpoledb ";
OleDbConnection oleconn_obj=new OleDbConnection();
oleconn_obj.ConnectionString=str_conn;
oleconn_obj.Open();
OleDbCommand myCommand=new OleDbCommand(str_ole,oleconn_obj);
int count = myCommand.ExecuteNonQuery(); //此处出错。
错误为:
System.Data.OleDb.OleDbException: Not a table.
请大家帮忙了,谢谢!!(存在zs.dbf文件)
------解决方案--------------------string str_ole = "select * from zs ";
------解决方案--------------------string str_conn = "data source = F:\\Solution\\Dbf库;provider = vfpoledb ";
改为:
string str_conn = "data source = F:\\Solution\\Dbf库\;provider = vfpoledb ";
试试
------解决方案--------------------string str_conn = "data source = F:\\Solution\\Dbf库;provider = vfpoledb ";
这个连接语句好像有问题,检查一下