Hi guys im doing a wee project at the minute i need to add a record to a database from a windows form on event button click (coded in c#) ive got code sorted that doesnt error however it doesnt save the records that i enter either i will post the code any help would be greatly appreciated
private void confirmbut_Click(object sender, EventArgs e) { OleDbConnection Conn = new OleDbConnection ( "Provider=Microsoft.ACE.OLEDB.12.0; Data Source= H:\\VRUSLTD\\VRUS.accdb");
OleDbCommand Cmd = new OleDbCommand ("INSERT INTO Rental_Details(RentalID,Reg_No,CustID,StaffMember,PickUpDate,PickUpTime,Due_Back,DaysRental) SELECT '" + rentIDtb.Text + "','" + vehIDtb.Text + "','" + custIDtb + "','" + empIDtb + "','" + pickuptb + "','" + picktimetb + "','" + returntb + "','" + daystb + "';", Conn); }
|
Kirtan PatelPosted Dec 1, 2009, 5:59 PM
Here is Your Modified Code ..I have Corrected Some Mistakes ..