Original Post
Hi, I'm quite new and have been looking for good advice! Lucky you. Anywayss, I'm writing a program which has to INSERT data into my Access database. Simple, atleast it should be. Having trouble though, its not actually doing it. Can't figure it out either, I assume it mys SQL statement. I don't know how else I'd write it at least. Permissions may be an issue, I'm not sure. Heres the code:
Int64 id, ctele;
id = Convert.ToInt64(lbl_add_Id.Text);
string cname, caddress, cpost;
cname = txt_Add_Name.Text;
caddress = txt_Add_Address.Text;
cpost = txt_Add_PC.Text;
ctele = Convert.ToInt64(txt_Add_Tele.Text);
//SQL adapter to gain access to the database, including the SQL statement
OleDbDataAdapter da_Customer_View = new OleDbDataAdapter(
"INSERT INTO tbl_Customers" +
"VALUES('" + (id) + "'" + ",'" + (cname) + "','" + (caddress) + "','" + (cpost) + "','" + (ctele) + "')",
"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Documents and Settings\\Me\\My Documents\\"
+ "SQL Databases\\XMAS SQL Database\\FoodTastic.accdb");
lst_New_Customers.Items.Clear();
UpdateCustomer();
Any idas?