访问数据库的提供者名称是什么 [英] what is the provider name for access databse
问题描述
我正在visual studio 2010中进行注册,并将我的应用程序与访问数据库连接....但它在提供者名称中显示一些错误...我编写的代码是: -
i am making a registration in visual studio 2010 and connecting my application with access database....but it is showing some error in provider name...the code i have written is:-
              string CS =(" database = registration; Provider = Microsoft.ACE.OLEDB.7.0");
              OleDbConnection con = new OleDbConnection(CS);
              OleDbCommand cmd = new OleDbCommand(" Insert into Table1 values(@ name,@ username,@ password)",con);
              cmd.Parameters.AddWithValue(" name",TextBox1.Text);
              cmd.Parameters.AddWithValue(" username",TextBox2.Text);
              cmd.Parameters.AddWithValue(" password",TextBox3.Text);
              con.Open();
              cmd.ExecuteNonQuery();
              con.Close();
string CS = ("database= registration ; Provider=Microsoft.ACE.OLEDB.7.0");
OleDbConnection con = new OleDbConnection(CS);
OleDbCommand cmd = new OleDbCommand("Insert into Table1 values(@name,@username,@password)", con);
cmd.Parameters.AddWithValue("name", TextBox1.Text);
cmd.Parameters.AddWithValue("username", TextBox2.Text);
cmd.Parameters.AddWithValue("password", TextBox3.Text);
con.Open();
cmd.ExecuteNonQuery();
con.Close();
并显示错误是InvalidOperationException未被用户代码处理错误
and the error showing is InvalidOperationException was unhandled by the user code with this error
('Microsoft.Jet。 OLEDB.7.0'提供商未在本地计算机上注册。")
(The 'Microsoft.Jet.OLEDB.7.0' provider is not registered on the local machine.")
推荐答案
shubham97 -
shubham97 --
您已发布Visual Studio问题一个专门用于Project Online的用户论坛,这是一个企业项目管理工具。 我建议您在Visual Studio论坛中重新发布您的问题。 希望这会有所帮助。
You have posted your Visual Studio question in a user forum dedicated to Project Online, an enterprise project management tool. I would recommend you repost your question in a Visual Studio forum. Hope this helps.
这篇关于访问数据库的提供者名称是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!