Insert Into Visual Foxpro Error...
I am trying to insert data into a vfp table named tblVFP1.dbf, which has 142 fields. I just want to insert the first 2 fields while leave other 14o fields intact, but I got the following infomation:
ro_stock is not allowed to be empty....
When I include this fileld in string---s another similar error info prompt indication other fields are not allowed to be empty...
It seem that all fields are required to insert one record to my table, so I changed my code to:
//// all the 142 fields are included in string s.
string s="insert into tblVFP1 (ro_repref,ro_account,ro_stock..........)"
+ "values ('"+s_repref+"','"+ro_account.............+"')";
try
{
OleDbCommand cmdt=new OleDbCommand();
OleDbCommand cmdt0=new OleDbCommand();
cmdt0.CommandText="SET NULL OFF";
cmdt0.Connection=connt;
cmdt0.ExecuteNonQuery();
cmdt.CommandText=s;
cmdt.Connection=connt;
int i=cmdt.ExecuteNonQuery();
operaConnt.Close();
MessageBox.Show("rows inserted into opera PPO="+i.ToString());
}
catch(Exception ee)
{
MessageBox.Show(ee.Message);
}
but when implementation, I got the following error: too many argument.
What is wrong with my program? I am sure the connection I built is right..
thanks