Re: Update Database from DataAdapter

From: Strider (Strider_at_discussions.microsoft.com)
Date: 09/27/04


Date: Mon, 27 Sep 2004 02:05:08 -0700

thank you very much that link should help me so much

cheers

"Val Mazur" wrote:

> Hi,
>
> Bill already mentioned that you would need to create action queries to
> update data. Check next KB with some examples how to do this
>
> http://support.microsoft.com/default.aspx?scid=kb;en-us;310347
>
> --
> Val Mazur
> Microsoft MVP
>
>
> "Strider" <Strider@discussions.microsoft.com> wrote in message
> news:356D163D-992C-419B-ACF1-703A01890D70@microsoft.com...
> > Here is my code of what im trying to do. What should i change to this
> >
> > Public Shared Function UpdateTable(ByVal ds As DataSet, ByVal dbloc As
> > String, ByVal tableName As String)
> > Try
> > 'Create a connection to the new database.
> > Dim ssceconn As New SqlCeConnection("Data Source = " & dbloc)
> > Dim sqlDA As SqlCeDataAdapter
> >
> > 'Select everything from the Routes table.
> > sqlDA = New SqlCeDataAdapter("SELECT * FROM " & tableName,
> > ssceconn)
> >
> > sqlDA.Update(ds, tableName)
> > Catch err As SqlCeException
> > MsgBox(err.Message)
> > End Try
> > End Function
> >
> > "Val Mazur" wrote:
> >
> >> Hi,
> >>
> >> Calling Update should do this, but in a case of your DataSet was
> >> populated
> >> using Dataadapter (DA). In a case if your dataSet fall fabricated, then
> >> DA
> >> will not know anything about underlying database. Another potential issue
> >> is
> >> the you call AcceptChanges before calling Update method of DA. In this
> >> case
> >> AcceptChanges will reset state of the rows to unmodified and DA will not
> >> see
> >> any changes in a DataSet.
> >>
> >> --
> >> Val Mazur
> >> Microsoft MVP
> >>
> >>
> >> "Strider" <Strider@discussions.microsoft.com> wrote in message
> >> news:C934CEFE-DC65-43DA-B1B5-4B6E242E4715@microsoft.com...
> >> > Hey,
> >> > here is my problem. I have a dataSet which contains data that i want to
> >> > add
> >> > to my database. But i dont know how to update the dataadapter with the
> >> > dataset.
> >> > i've tried da.update(ds,tableName) but it does not update it.
> >> >
> >> > can anyone help
> >> >
> >> > Cheers
> >>
> >>
> >>
>
>
>



Relevant Pages

  • Re: Update Database from DataAdapter
    ... Public Shared Function UpdateTable(ByVal ds As DataSet, ByVal dbloc As ... String, ByVal tableName As String) ... > the you call AcceptChanges before calling Update method of DA. ...
    (microsoft.public.data.ado)
  • Re: Recordset question
    ... Set rsRecordset2 = New Recordset ... Dim sData As String ... Dim intDP As Integer ... >>> Val Mazur ...
    (microsoft.public.vb.database.ado)
  • Re: Multiple-step operation error using Oracle
    ... Apparently, if it is possible for there to be duplicates in the recordset, ... > Dave Eisenbraun ... >> string to it, then you might get this error, depending on what string ... >> Val Mazur ...
    (microsoft.public.data.ado)
  • Re: Filter and two wildcars error
    ... You need to put wildcards into single quotes inside the string ... Val Mazur ... Microsoft MVP ...
    (microsoft.public.data.ado)
  • Re: Can I use the SQL "Table" Datatype to pass parameter info from VB?
    ... Suggesting to use XML has a special issue. ... Passing this string basically gives any person ... Val Mazur ... > to SQL Server should be a given. ...
    (microsoft.public.vb.database.ado)