这是什么错误 [英] what is the error in it

查看:80
本文介绍了这是什么错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi


hi


OleDbConnection con = new OleDbConnection("provider =Microsoft.JET.OLEDB.4.0;data source=D:\\connect\\customer.mdb");
                con.Open();
               OleDbCommand cmd = new OleDbCommand("Insert into add values(''"+nametxt.Text+"'',''"+emailtxt.Text+""+comboBox3.SelectedItem.ToString()+"'',''"+religiontxt.Text +"'',''"+dobtxt.Text+"'',''"+languagetxt.Text +"'',''"+mobiltxt.Text+"'',''"+statetxt.SelectedItem.ToString()+"'',''"+citytxt.SelectedItem.ToString()+"'',''"+areatxt.Text+"'',''"+strtxt.Text +"'',''"+htxt.Text +"'',''"+pintxt.Text +"'',''"+landtxt.Text +"'',''"+snametxt.Text +"'',''"+dobtxt1.Text +"'',''"+wedtxt.Text +"'',''"+cnametxt.Text +"'',''"+dobtxt2.Text +"'',''"+cnametxt1.Text +"'',''"+dobtxt3.Text +"'')", con);
               // OleDbCommand cmd = new OleDbCommand("Insert  into add values(''s'',''a'',''a'',''a'',''a'',''a'',''a'',''a'',''a'',''a'',''a'',''a'',''a'',''a'',''a'',''a'',''a'',''a'',''a'',''a'')", con);
               cmd.ExecuteNonQuery();
                MessageBox.Show("Added " + nametxt.Text + " as your customer", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                con.Close();




显示为
的连接有什么错误? access2003数据库包含20个字段对象引用未设置为对象的实例."

因为我为此简单的事情浪费了将近一个小时,但我不知道他是什么原因

请帮助我




what is the error in the connection it was showing as
"Object reference not set to an instance of an object." the access2003 database contains 20 fields

for i am wasting nearly one hour fo rthis simple thing but i dont know what is he reason

please help me

推荐答案

OleDbCommand cmd = new OleDbCommand("Insert into add values (''siva'',''sivakumar'',[MISSING QUOTE HERE] sivakumarsg'',''s'',''as'',''as'',''a'',''d'',''f'',''g'',''h'',''j'',''k'',''l'',''ssd'',''s'',''sd'',''sd'',''sd'',''sde'',''s'',''d'',''d'',''sdf'',''sf'',''sdf'',''sf'',''sdsf'')", con);


:)


这篇关于这是什么错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆