Materialized.
Make next time your SQL string not so complicated to ask a question. What
you ask is in my opinion something as this
Dim SQLString As String
SQLString = "SELECT MyVariables from MyTable WHERE (VariableA = @One OR
VariableA = @Two")
And than manually using directly the SQLDataAdapter and not the new factored
DBprovider
\\\
dim dt as new datatable
dim conn as new SqlClient.SQLConnection("AConnectionsString")
dim da as new SqlClient.SQLDataAdapter(conn,SQLString)
Set the parameters see for that this link
http://www.vb-tips.com/default.aspx?...6-7139b8970071
da.fill(dt)
datagrid1.datasource = dt
///
All typed here so watch typos or whatever. This is very simple, you need a
Try block and as well can you set the parameters more efficient. See
partially this sample for that.
http://www.vb-tips.com/default.aspx?...a-ae802ee71c86
Using this, you can set the fill and the parameterpart in a section where
the user clicks a button to accept the values.
(The try and catch is as well not in the second sample, if you need help for
that when you have tried this, than ask again)
I hope this helps,
Cor
"Materialised" <ma**********@privacy.net> schreef in bericht
news:40*************@individual.net...
Sorry Cor,
Let me attempt to rephrase.
Basically I have a data grid control on a form. What I wish to do is
populate this control based on the values (2 No.) that a user inputs.
For example, If the user were to enter the values 22 and 76, the data grid
would only be populated with items within that range.
I can do this using the VS.Net 2005 Query build no problem, however I am
having trouble figuring how to do it manually, i.e using a custom SQL
statement with my dataadapter to populate the datagrid.
Hope this clears some issues up with my post.
Regards
Materialised