Updating a MS access database from the C# code on asp.net web form -
im beginner @ coding , need understanding why line below not word "item" in , giving me error message:
('system.web.ui.webcontrols.gridview' not contain definition 'item' , no extension method 'item' accepting first argument of type 'system.web.ui.webcontrols.gridview' found (are missing using directive or assembly reference?)')
or knows of better way update ms access database web form?
any get, appreciated...
namespace financesystemvs2013_05._02._14 {
public partial class payment_allocation_page : system.web.ui.page { oledbconnection connection; protected void page_load(object sender, eventargs e) { connection = new oledbconnection("provider=microsoft.jet.oledb.4.0;data source=s:\\my documents\\university work\\year 3\\research methodologies , emerging technologie\\financesystemvs2013_05.02.14 05.03.14\\accounting_system.accdb;persist security info=false"); } protected void button1_click(object sender, eventargs e) { oledbdataadapter dataadapter = new oledbdataadapter("select * payment_allocation", connection); dataset ds = new dataset(); dataadapter.fill(ds, "payment_allocation"); foreach (datarow datarow in ds.tables[0].rows) { //this line not "item" (paymentallocationdb gridview) paymentallocationdb.item.add(datarow["payment_amount"].tostring()); } } private void updatedatabase() { oledbcommand cmd = new oledbcommand(); cmd.connection = connection; cmd.commandtext = "update s_transaction_enquiry set s.payment_amount = p.payment_amount s_transaction_enquiry s join payment_allocation p on p.s_invoice_numer = s.s_invoice_number"; cmd.executenonquery(); } } }
Comments
Post a Comment