.net coding

Hey all, i have a slight problem with my code.
I have a database in access called Suppliers, which has two tables-Suplier_Master and Supplier_Accounts, in which i want to perform an insertion operation. The problem is that though the system does not show any errors, there is no insertion happening in the database table either. I have practically given up trying to solve this problem. Any help would be appreciated.
the code is as follows:



string cnstr1 = ConfigurationManager.ConnectionStrings["WindowsFormsApplication3.Properties.Settings.SupplierConnectionString"].ConnectionString;
OleDbConnection sup=new OleDbConnection();
sup.ConnectionString=cnstr1;
sup.Open();


string updates = string.Format("Insert into Supplier_Accounts" + "(Supplier_Name,S_Amt_Payable,S_Amt_Paid,S_Due_Date,Order_Date,Item,Rate,Quantity)" +
"Values('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}')",supplier, AmountDue, AmountPaid, DueDate, today, desc, rate, Quantity);

using (OleDbCommand cmds = new OleDbCommand(updates, sup))
{
cmds.ExecuteNonQuery();
}
string s = string.Format("Update Suplier_Master Set S_Amt_Pending='{0}' where Supplier_Name='{1}'", AmtPending, supplier);
using (OleDbCommand cmdsp = new OleDbCommand(s, sup))
{
cmdsp.ExecuteNonQuery();
}

Replies

  • Eniine
    Eniine
    look the databases if are set the primary key

You are reading an archived discussion.

Related Posts

Hi, I am Siva Kumar from Chengalpat, a town in Tamilnadu, India. I found this site in Google. I am second year student doing Information Technology. I hope this site...
can i determine that in which direction an IR emitter has been placed by using a IR sensor???
This section is for all the CEans (Final year students)who don't have a job yet. I wish to know what alternate plan have you thought of? Share your thoughts, ideas...
All I know about EVDO is that it stands for Evolution-Data Optimized. I'm sure all telecommunication engineering students would shed some more light on this topic. What are advantages/disadvantages of...
😎 hai frnds jst suggest me one good ieee project for my m.tech comp science.