DataAdapter with different SQL's



Hello,

Created dataadapter select with this command
"select * from emp where empid IN (123,456,789)";

Filled and sent dataset to remote client. lost original dataadapter

Remote client works with the dataset and sends it back
Created a new dataadapter select with this command
"select * from emp where 1=2; (effectively a null set)
populate the update/insert/deletes commands on the dataadapter based on
the 2nd above select

Called the Update method of the dataadapter.
All changes get affected to the database.

Question 1 : Can/should i create the dataset with one select command
and at time of update create another select command based on a
different sql. (i use this method as when i pass the dataset to the
remote site i dont pass the parameters used to create the original sql,
so at time of return i dont know/unaware of the original sql).

Question 2 : Does this mean that dataadapter works in such a way that
it needs only to know the end table & fields without knowing the
original data associated, i.e. the dataset set has all the intellegence
of old rows/newsrows contained in it.

Thanks
Ivan

.



Relevant Pages

  • Re: DataAdapter with different SQLs
    ... > Created dataadapter select with this command ... > Filled and sent dataset to remote client. ... > Created a new dataadapter select with this command ... original data. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: dataAdapter not updating - but sqlcommand works OK
    ... primary key and I am not using the wizard to generate the dataAdapter. ... select command works fine on the data adapter. ... Dim conn As sqlConnection, cmdDel As SqlCommand ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Dataadabter update command throws error
    ... I had given the dataadapter scope of the entire form (Protected da As New ... >> with the dataadapter update command since it doesn't know that fields it ... The datagrid displays the data fine. ... the dataadapter cannot update the database because it ...
    (microsoft.public.dotnet.languages.vb)
  • Re: OleDbDataAdapter created in code behaves differently from one created by wizard.
    ... When you create the dataadapter with the designer, ... and attach them correctly to the DataAdapter. ... command as you like, setting the connection, commandText properties etc. ... I know the adapter created in code is OK because I use it to ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: DataAdapter with different SQLs
    ... >> Created dataadapter select with this command ... >> Filled and sent dataset to remote client. ... >> Created a new dataadapter select with this command ... > original data. ...
    (microsoft.public.dotnet.framework.adonet)

Loading