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)
{
......
挺繁琐,之前发的帖子,分值太低现在重发一个。欢迎各位大侠~~
#include "stdlib.h"
#include "math.h"
#include "stdio.h"
float objfx(float x[]);
void constraint(float x[] ......
公司开发一个触摸屏程序,我负责的一块,实现这样一个功能,当鼠标点击窗口中图片(一张图分成几部分)的其中一部分时,将这部分图片截取出来,弹出新的窗口,将截取出的图片显示出来。我使用Rectange类控制了返回, ......
用listview显示出从数据库中查询出的记录,想在最后记录后面添加一条合计行,如何实现!谢谢大家!
绑定数据你应该没问题吧,绑定完以后用一个循环把你要统计数据的列中的数据总和用一个变量接受,然后在循环外面ne ......