Re: changing a datasets contents
- From: "Heath P. Dillon" <Heath@xxxxxxxxxxxxx>
- Date: Fri, 13 Mar 2009 13:20:03 +1100
I don't want to do this via the wizard, as I need this to change as the user uses the program.
I need to be able to change the query via vb.net at run time
Any thoughts ?
"Miro" <miro@xxxxxxxxx> wrote in message news:%23aBeg4xoJHA.3896@xxxxxxxxxxxxxxxxxxxxxxx
If you used the wizard, take a look at the parameter class.
It will create a variable with an @symbol...
If you are using an access table - it will be a question mark.
example on access: (written in notepad)
SELECT Name
FROM Names
Where CustID = ?
or
In SQL ( written in notepad )
SELECT Name
FROM Names
Where CustID = @Name
If you click on your tableadapter and click on Query Builder, you should see a "Filter" column. That is the column you want to put in the @/? parameter.
So just go to your table, either edit the table adapter you have, or create a new one and call that one.
Hope that makes sense.
Miro
"NoSpamMan" <no@xxxxxxxx> wrote in message news:OSq9RfxoJHA.5980@xxxxxxxxxxxxxxxxxxxxxxxHi,
I created a dataset via adding a new item (dataset) to my project. Following through the wizard I have now complete a data set that contains data. (select the tables, create the joins and enter the first where clause (abc=1). This works fine.
My question is that the query that I build in the dataset wizard in my project, needs to now change its where clause. (select ...... where abc= 1 now needs to be abc=2)
Is there a way to change the datasets select statement ?
How do I do this in my vb.net code ? I can't have a dataset for every possible where clause, as there are several thoughs values for abc ?
.
- Follow-Ups:
- Re: changing a datasets contents
- From: Miro
- Re: changing a datasets contents
- References:
- changing a datasets contents
- From: NoSpamMan
- Re: changing a datasets contents
- From: Miro
- changing a datasets contents
- Prev by Date: Re: what is the different of the member variable and property?
- Next by Date: Re: Delegate question
- Previous by thread: Re: changing a datasets contents
- Next by thread: Re: changing a datasets contents
- Index(es):
Relevant Pages
|