首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

找不到可装配的ISAM

2013-01-23 
找不到可安装的ISAMusing Systemusing System.Collections.Genericusing System.Textusing System.Xml

找不到可安装的ISAM
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# ISAM c# access
[解决办法]
第一 自己调试  看哪一步报错,既然是书上的实例那应该不会错  你贴出代码我们也看不出问题 
第二 找不到可安装的ISAM 这个错误一百度出来一大把 可能出现的情况比较多 自己百度下 看哪一种情况最符合你

热点排行