E
Edbone
Hello all. I am new to VB.Net, but have been porgramming in VB for a
few years. I am trying to migrate to VB.Net, and until I hit ADO.Net,
I was pretty impressed. I don't think I am getting this right. From
what I have read, in order to update a database, using changed data
from a datagrid, a DataAdapter, and a DataSet you have to write a
small program. I have never liked the performance of the data
controls in VB, so I am not using the DataAdapter in VB.Net, although
they may be faster. What I guess I am asking is this, is there an
easier way? This is where I am at now...
Dim strConn, strSQL As String
strConn = "Provider=Advantage OLE DB Provider;Data
Source=w2k3srv1\databases\ads\csgdata ;Advantage Server
Type=ADS_REMOTE_SERVER"
strSQL = "Select * from collectorinfo order by username"
da = New OleDbDataAdapter(strSQL, strConn)
ds = New DataSet
da.Fill(ds, "CollectorInfo")
DataGrid1.DataSource = ds
DataGrid1.DataMember = "CollectorInfo"
No problem, and to change the data in the dataset to correspond to
changes in the datagrid I am doing this.
If ds.HasChanges Then ds.AcceptChanges()
Again, no problem, the dataset is updated, but how do I get these
changes to the DB table without writing SQL statements? Looking at
the code the DataAdapter control created, I have to ask - does all
that need to be done just to update a field in a table.
Thanks for reading, and if you do, replying
-Eddie
few years. I am trying to migrate to VB.Net, and until I hit ADO.Net,
I was pretty impressed. I don't think I am getting this right. From
what I have read, in order to update a database, using changed data
from a datagrid, a DataAdapter, and a DataSet you have to write a
small program. I have never liked the performance of the data
controls in VB, so I am not using the DataAdapter in VB.Net, although
they may be faster. What I guess I am asking is this, is there an
easier way? This is where I am at now...
Dim strConn, strSQL As String
strConn = "Provider=Advantage OLE DB Provider;Data
Source=w2k3srv1\databases\ads\csgdata ;Advantage Server
Type=ADS_REMOTE_SERVER"
strSQL = "Select * from collectorinfo order by username"
da = New OleDbDataAdapter(strSQL, strConn)
ds = New DataSet
da.Fill(ds, "CollectorInfo")
DataGrid1.DataSource = ds
DataGrid1.DataMember = "CollectorInfo"
No problem, and to change the data in the dataset to correspond to
changes in the datagrid I am doing this.
If ds.HasChanges Then ds.AcceptChanges()
Again, no problem, the dataset is updated, but how do I get these
changes to the DB table without writing SQL statements? Looking at
the code the DataAdapter control created, I have to ask - does all
that need to be done just to update a field in a table.
Thanks for reading, and if you do, replying

-Eddie