mphillip85
asked on
update data on table with datagrid, where I am usedto usign 2003 now trying to do it in 2005
I am now using 2005. How do I update.delete,edit with datagridview whereas I used to use a
dbcon then data adapter, then a dataset, thenmonitored the changes.
How do I do it in 2005.
Thanks
dbcon then data adapter, then a dataset, thenmonitored the changes.
How do I do it in 2005.
Thanks
ASKER
can you throw me a few lines as what are the new ways.
I seem to have 2 icons
1 data connection
1 dataset that ties to the datagridview
so what code do i need to just add a row in the datagrid, then update the table
before I would do a dataadapter.update(dataset )
or dataadapter.upadatecommand .commandte xt = update table myfield = my value where myid = id
dataadapter.executescalar
Just a quick new few lines will get me going in the right direction. tghanks
I seem to have 2 icons
1 data connection
1 dataset that ties to the datagridview
so what code do i need to just add a row in the datagrid, then update the table
before I would do a dataadapter.update(dataset
or dataadapter.upadatecommand
dataadapter.executescalar
Just a quick new few lines will get me going in the right direction. tghanks
ASKER
here is my code :
Function DataGridUpdate()
On Error Resume Next
If Me.Redwood_III.State = ConnectionState.Closed Then
Me.Redwood_III.Open()
End If
Me.DA_MaintainSites.Update (Me.DS_Mai ntainSites )
Me.DA_MaintainSites.Update Command.Ex ecuteScala r()
Me.DA_MaintainSites.Fill(M e.DS_Maint ainSites)
Return Nothing
End Function
Private Sub ftp_http_DataGridView_Cell ValueChang ed(ByVal sender As Object, ByVal e As System.Windows.Forms.DataG ridViewCel lEventArgs ) Handles ftp_http_DataGridView.Cell ValueChang ed
DataGridUpdate()
End Sub
it works it stops its partial works.
?
shall I close and re-open connection each time I call the function?
Function DataGridUpdate()
On Error Resume Next
If Me.Redwood_III.State = ConnectionState.Closed Then
Me.Redwood_III.Open()
End If
Me.DA_MaintainSites.Update
Me.DA_MaintainSites.Update
Me.DA_MaintainSites.Fill(M
Return Nothing
End Function
Private Sub ftp_http_DataGridView_Cell
DataGridUpdate()
End Sub
it works it stops its partial works.
?
shall I close and re-open connection each time I call the function?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
There is really not that big change's regarding working against datasource's in 2005
But if you are or want to work with designer/wizzards i think there are alot of improvements in that regard.
Here is a walktrough
http://msdn2.microsoft.com/en-us/library/fxsa23t6(VS.80).aspx
Walkthrough: Saving Data to a Database
http://msdn2.microsoft.com/en-us/library/0f92s97z(VS.80).aspx
Though you can still use data adapter instead of the tableadapter provided in 2005
http://msdn2.microsoft.com/en-us/library/ss7fbaez.aspx
But in 2005 intellisence provides the capabillity to visual examine objects , data containers ,dataset's, ect... in debug mode which i think is one of the really good new features in 2005.
vbturbo