Hi all,
got a problem and I'm starting to think what I am trying to achieve may not even be possible..
I want to programatically add a new row to my bound datagrid view. I've read a lot of times that I need to add the new row to my binding source as opposed to my datagridview.
Will this mean that the row is added to the database at that point because ideally I would prefer to add many rows then commit them to the database.
Would someone mind showing me how to do that (if its even possible). My current code is below but because I don't fully understand how it works, it's throwing up errors.
thanks in advance for any replies.
John
.NET 2.0, Visual Studio 2005, SQL Server 2005 Express
got a problem and I'm starting to think what I am trying to achieve may not even be possible..
I want to programatically add a new row to my bound datagrid view. I've read a lot of times that I need to add the new row to my binding source as opposed to my datagridview.
Will this mean that the row is added to the database at that point because ideally I would prefer to add many rows then commit them to the database.
Would someone mind showing me how to do that (if its even possible). My current code is below but because I don't fully understand how it works, it's throwing up errors.
Code:
Dim dt = TblJobsBindingSource
Dim dr As DataRow = dt.NewRow
dr("JobNumber") = "12345"
dr("Customer") = "Dave"
dt.Rows.Add(dr)
thanks in advance for any replies.
John
.NET 2.0, Visual Studio 2005, SQL Server 2005 Express