using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using System.Collections;
using System.Windows.Forms;
using System.Data;
using System.Data.OleDb;
using System.Data.SqlClient;
using System.Reflection;namespace ConAccess
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
} private void button1_Click(object sender, EventArgs e)
{
Application.Exit();
} private void Form1_Load(object sender, EventArgs e)
{
DataSet ds = new DataSet();
//定义连接字符串
string strFilePath = "Provider=Microsoft.Jet.OLEDB.4.0;Data source=" + Application.StartupPath + "\\DB_Test.mdb";
//定义连接数据源
string sql = "select * from 员工信息";
//声明一个数据连接
System.Data.OleDb.OleDbConnection con = new OleDbConnection(strFilePath);
System.Data.OleDb.OleDbDataAdapter da = new OleDbDataAdapter(sql, con); try
{
da.Fill(ds);
if (ds.Tables[0].Rows.Count >1)
{
dataGridView1.DataSource = ds.Tables[0];
} }
catch (Exception ex)
{
throw new Exception(ex.ToString());
}
finally
{
con.Close();
con.Dispose();
da.Dispose();
}
}
}
}
这是书上的一个实例,我在用vs2010直接运行时出错了:找不到可安装的ISAM,谁能帮忙解决一下啊
ISAM C#ISAMc#access
using System.Collections.Generic;
using System.Text;
using System.Xml;
using System.Collections;
using System.Windows.Forms;
using System.Data;
using System.Data.OleDb;
using System.Data.SqlClient;
using System.Reflection;namespace ConAccess
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
} private void button1_Click(object sender, EventArgs e)
{
Application.Exit();
} private void Form1_Load(object sender, EventArgs e)
{
DataSet ds = new DataSet();
//定义连接字符串
string strFilePath = "Provider=Microsoft.Jet.OLEDB.4.0;Data source=" + Application.StartupPath + "\\DB_Test.mdb";
//定义连接数据源
string sql = "select * from 员工信息";
//声明一个数据连接
System.Data.OleDb.OleDbConnection con = new OleDbConnection(strFilePath);
System.Data.OleDb.OleDbDataAdapter da = new OleDbDataAdapter(sql, con); try
{
da.Fill(ds);
if (ds.Tables[0].Rows.Count >1)
{
dataGridView1.DataSource = ds.Tables[0];
} }
catch (Exception ex)
{
throw new Exception(ex.ToString());
}
finally
{
con.Close();
con.Dispose();
da.Dispose();
}
}
}
}
这是书上的一个实例,我在用vs2010直接运行时出错了:找不到可安装的ISAM,谁能帮忙解决一下啊
ISAM C#ISAMc#access
第二 找不到可安装的ISAM 这个错误一百度出来一大把 可能出现的情况比较多 自己百度下 看哪一种情况最符合你