Re: VB.NET 2005 TableAdapter

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance




"ken" <kk> wrote in message news:uJc5oZCoGHA.2264@xxxxxxxxxxxxxxxxxxxxxxx
In VB.NET 2005, the ADO.NET provide TableAdapter for Developer eaily code
the
query and parameter query by "Query Builder".

I can build a single parameter or multi parameters SQL Query by using
"Query Builder"
(WHERE ClientCode = @ClientCode ....etc)
But how about if I wanna to build a programmatic SQL statament,
say if the User select ClientCode and OrderType buttom on UI,
I will processing the SQL statment as: WHERE ClientCode ... AND OrderType
....;
if the User select ClientCode and OrderType and Status, the SQL statement
now processing as:
WHERE ClientCode ... AND OrderType .... AND Status ......

Is that anyway to code the above SQL by "Query Builder" in TableAdapter
!?
Sure, you can build your sql statement (however, please use Parameters even
if you're building dynamic sql b/c otherwise there's a lot of headaches
associated with not using parameters) and then set the string to the
TableAdapter's SelectCommand (or UpdateCommand/DeleteCommand/InsertCommand)





.


Quantcast