C#连接Access数据库问题 - .NET技术 / C#
我写了一段很简单的用ado.net连接数据库的代码,可是运行后提示没事可安装的ISAM!
这是什么意思?我该怎么做才能正常连接。
代码如下:
C# code:
static void Main(string[] args)
{
OleDbConnection thisConnection = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;DataSource=Human.mdb");
thisConnection.Open();
OleDbCommand thisCommand = thisConnection.CreateCommand();
thisCommand.CommandText = "SELECT xm,xb from human";
OleDbDataReader thisReader = thisCommand.ExecuteReader();
while(thisReader .Read())
{
Console.WriteLine("\t{0}\t{1}",thisReader["xm"],thisReader ["xb"]);
}
thisReader.Close ();
thisConnection.Close();
Console .Write ("Program finished,press Enter/Return to continue:");
Console.ReadLine();
}
连接字符串不正确。
谢谢啊 原来是这样啊
相关问答:
写了个测试程序如下
struct hostent *hp;
char AlarmDevIP[20];
int x2;
hp = gethostbyname("www.google.com");
if (hp)
{
......
请问VFP中如何调用C/C++函数?
你要调用什么功能的函数?要看看VFP中有没有对应的函数,如果有就省着再调用了。如果没有,可以将C/C++函数写个DLL或FLL,然后在VFP调用即可。
十豆三 老师,怎么才能修改自己的 ......
DataSet导出xml 批处理(循环)得怎么处理
XML文件
<A>
<B>
<C>
</C>
&nb ......
谁能帮我把下面这些代码改成VB形式的,多谢了,急用~~
#include "stdlib.h"
#include "math.h"
#include "stdio.h"
float objfx(float x[]);
void constraint(float x[],float g ......
使用ACCESS最大的隐患就是不安全。今天对ACCESS数据库设置了一个密码,必须使用密码才能打开,但是在程序中却无法连接数据库了。大家知道使用用户名和密码,如何连接ACCESS数据库?貌似ACCESS的用户名还不知道?只知 ......