Select statement after the sqldataadapter Update statement

  • Thread starter Thread starter Igor
  • Start date Start date
I

Igor

How can I modify the Select statement after the Update statement in
sqldataadapter ADO 2.0? (add columns)
 
Ah, simply change the SelectCommand on the DataAdapter. The question is,
will the CommandBuilder pick up that change (if it's being used) or will the
bound controls or other VS-generated code pick up the change.

--
__________________________________________________________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
(425) 556-9205 (Pacific time)
Hitchhiker’s Guide to Visual Studio and SQL Server (7th Edition)
____________________________________________________________________________________________
 
I changed the SelectCommand and VS picked the changes but not the final
version of the Select command.
Now I'm using SqlUpdateCommand4.CommandText ="update query; a very long
select query..." in the Load Sub.
Can I somehow force VS to pick new select query?
I liked more VS2003 way to do this. There I could edit select query after
the update or insert.
 
Not really. Consider that the VS tools are generating a strongly typed
DataSet at design time--not at runtime. There is no mechanism to generate
the code at runtime.

--
__________________________________________________________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
(425) 556-9205 (Pacific time)
Hitchhiker’s Guide to Visual Studio and SQL Server (7th Edition)
____________________________________________________________________________________________
Igor said:
I changed the SelectCommand and VS picked the changes but not the final
version of the Select command.
Now I'm using SqlUpdateCommand4.CommandText ="update query; a very long
select query..." in the Load Sub.
Can I somehow force VS to pick new select query?
I liked more VS2003 way to do this. There I could edit select query after
the update or insert.
 
Bill,
Ah, simply change the SelectCommand on the DataAdapter. The question is,
will the CommandBuilder pick up that change (if it's being used) or will
the bound controls or other VS-generated code pick up the change.


The magic commandbuilder will only pick up those items which are accoording
to the fill part of the DBDataAdapter.

Cor
 
I modified the Select command at design time (with Query Builder) and
generated strong typed dataset by righ clicking on the DataAdapter and
"generate Dataset" command.
New columns are added to the Dataset and after DataAdapter.Fill they are
filled with data but after adding new row to the database new columns are not
updated by the Select command after the Update command.
If I put in code "Debug.Writeline(SqlUpdateCommand4.CommandText)" in select
are missing two last added columns (I added them in Design mode and generated
strong typed dataset).
 
Back
Top