找不到可安装的 ISAM
<connectionStrings>
<add name= "dsn " connectionString= "Provider=Microsoft.Jet.OLEDB.4.0;Data Sourse=|DataDirectory|Test.mdb "/>
</connectionStrings>
=====================================
OleDbConnection conn = null;
OleDbCommand cmd = new OleDbCommand();
public DB()
{
conn = new OleDbConnection(ConfigurationManager.ConnectionStrings[ "dsn "].ConnectionString);
}
public OleDbConnection getConn()
{
if (conn.State == ConnectionState.Closed)
conn.Open();
return conn;
}
public void close()
{
if (conn.State == ConnectionState.Open)
conn.Close();
}
public void exeEq(string strSQL)//执行SQL语句
{
cmd.Connection = getConn();
cmd.CommandText = strSQL;
string strEq = cmd.ExecuteNonQuery().ToString();
close();
}
===============================
protected void btnAdd_Click(object sender, EventArgs e)
{
DB myDB = new DB();
myDB.exeEq( "INSERT INTO LeiXing (_Name) VALUES ( ' "+tbName.Text.Trim()+ " ') ");
Response.Write( " <script> alert( '添加成功! ') </script> ");
tbName.Text = " ";
}
=================================
代码何错之有?为什么调试到conn.Open()的时候,会出现找不到可安装的 ISAM 的提示?该如何解决?
------解决方案--------------------http://blog.csdn.net/net_lover/archive/2006/10/23/1346700.aspx