SQl Server express Edition
-
I have posted this question before but didn't post the code. The thing is for some reason, i cannot programatically Insert new row or update the database. However, I could fill the dataset after manaually populating the database. Could any help me. The permissions are set right and the folder that contains the database file is also writable. thank you. below is what i have ProductItemDataSet = new DataSet.DatabaseDataSet.ProductItemTableDataTable(); DataSet.DatabaseDataSetTableAdapters.ProductItemTableTableAdapter ProdAdapter = new DataSet.DatabaseDataSetTableAdapters.ProductItemTableTableAdapter(); ProdAdapter.Fill(ProductItemDataSet); ProdAdapter.Insert("man", "mango", "mango tree", ""); The database is in project Dataset. And this code exist in a different project but references the Dataset project.
Nana
-
I have posted this question before but didn't post the code. The thing is for some reason, i cannot programatically Insert new row or update the database. However, I could fill the dataset after manaually populating the database. Could any help me. The permissions are set right and the folder that contains the database file is also writable. thank you. below is what i have ProductItemDataSet = new DataSet.DatabaseDataSet.ProductItemTableDataTable(); DataSet.DatabaseDataSetTableAdapters.ProductItemTableTableAdapter ProdAdapter = new DataSet.DatabaseDataSetTableAdapters.ProductItemTableTableAdapter(); ProdAdapter.Fill(ProductItemDataSet); ProdAdapter.Insert("man", "mango", "mango tree", ""); The database is in project Dataset. And this code exist in a different project but references the Dataset project.
Nana
Hello to Nana you must use this code in FormLoad event for fill dataset: prodadapter.fill(productitemdataset); and use this code for add a new row to db: ProductItemdataset.(TableName).AddNew(TableName)Row(field1,...); ProdAdapter.Update(ProductItemDataset); Good Luck. Editali (Alireza Loghmani):)