Hi,
I have a datagrid which data i want to insert into sql table. I have tried the following code and it gives me an error:
I get the following error:
System.NullReferenceException was unhandled by user code
Message=Object reference not set to an instance of an object
What would be the best wat to insert a gridview.datasource to SQL table using LINQ( i am trying to learn it) or anything else at this point?
I have a datagrid which data i want to insert into sql table. I have tried the following code and it gives me an error:
VB.NET:
Dim db As New commissionsDataContext
db.gcstransactions.InsertAllOnSubmit(GridView1.DataSource)
db.SubmitChanges()
I get the following error:
System.NullReferenceException was unhandled by user code
Message=Object reference not set to an instance of an object
What would be the best wat to insert a gridview.datasource to SQL table using LINQ( i am trying to learn it) or anything else at this point?