本文介绍了C#访问插入错误!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

                      OleDbConnection con = new OleDbConnection();
           con.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" + Application.StartupPath + "\\kodmatikdatabase.accdb";

con.Open();
           OleDbCommand sorgu = new OleDbCommand(("insert into geneltablo (KodAdi,Aciklama,GirisTarihi,Link,ProgramlamaDili,Puan,Durum) values (@KodAdi,@Aciklama,@GirisTarihi,@Link,@ProgramlamaDili,@Puan,@Durum)"),con);
           sorgu.Parameters.AddWithValue("@KodAdi", textBox1.Text);
           sorgu.Parameters.AddWithValue("@Aciklama", richTextBox1.Text);
           sorgu.Parameters.AddWithValue("@GirisTarihi", dateTimePicker1.Text);
           sorgu.Parameters.AddWithValue("@Link", textBox2.Text);
           sorgu.Parameters.AddWithValue("@ProgramlamaDili", comboBox1.Text);
           sorgu.Parameters.AddWithValue("@Puan", comboBox3.Text);
           sorgu.Parameters.AddWithValue("@Durum", comboBox2.Text);


           sorgu.ExecuteNonQuery();




当我按下按钮


"sorgu.ExecuteNonQuery();"在这一行

总是给我这个错误

条件表达式中的数据类型不匹配."


怎么了 ? :confused :: confused :: confused:




when i push button


" sorgu.ExecuteNonQuery(); " in this line

always give me this error

"Data type mismatch in criteria expression."


What is wrong ? :confused::confused::confused:

推荐答案


这篇关于C#访问插入错误!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-03 09:47