Link to home
Start Free TrialLog in
Avatar of mphillip85
mphillip85Flag for United States of America

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
Avatar of vbturbo
vbturbo
Flag of Denmark image

Hi

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
Avatar of mphillip85

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.commandtext = 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

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_MaintainSites)
        Me.DA_MaintainSites.UpdateCommand.ExecuteScalar()

        Me.DA_MaintainSites.Fill(Me.DS_MaintainSites)

        Return Nothing
    End Function



 Private Sub ftp_http_DataGridView_CellValueChanged(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles ftp_http_DataGridView.CellValueChanged
        DataGridUpdate()
    End Sub

it works it stops its partial works.

?

shall I close and re-open connection each time I call the function?
SOLUTION
Avatar of vbturbo
vbturbo
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial