こんにちは私はまだこのエラーが発生していて、別の解決策を試しましたが、うまくいきません!これが私のコードです
私はこのようにapp.configファイルに接続文字列を入れました:
<connectionStrings>
<add name="ComputerManagement"
connectionString= "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=.. ; Integrated Security=false"/>
フォームのbutton_clickに次のコードを入力します。
try
{
OleDbConnection conn = new OleDbConnection(GetConnectionString());
OleDbCommand command = new OleDbCommand();
command.CommandType = CommandType.Text;
command.CommandText = "INSERT INTO Clients(C_name,C_phone ,C_mob ,C_add , C_email ,C_account) VALUES ('" + textBox1.Text + "','" + textBox2.Text + "','" + textBox3.Text + "','" + textBox4 + "','" + textBox5.Text + "','" + textBox6.Text + "')";
command.Connection = conn;
conn.Open();
command.ExecuteNonQuery();
conn.Close();
}
catch (Exception) { throw; }