Re: changing a datasets contents

Tech-Archive recommends: Fix windows errors by optimizing your registry



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@xxxxxxxxxxxxxxxxxxxxxxx
Hi,

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 ?




.



Relevant Pages

  • Re: Combo box wizard "Find & GoTo Record" missing in Access 2007 b
    ... "Brendan Reynolds" wrote: ... name, a query name, or a SQL statement in the Record Source property, ... The wizard no ...
    (microsoft.public.access.forms)
  • Re: Could not determine which columns uniquely identify the rows for (a table)
    ... The query I used in the wizard was; ... the only common link I could find was that the column ... It can however create the selects no matter what. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Access-check box - checked, if checked it opens another form?
    ... If you then use the Query Builder Wizard, you'll end up with a query which will "join" the two tables together so you can view related values from both tables. ... If you then use the Forms Wizard to build a form based on that Query, the Wizard will ask you if you want to use a subform or a linked form with this data. ... Either way, your users could use the standard record controls to add related records, with no programming. ...
    (microsoft.public.access.gettingstarted)
  • Re: Access combo box-show name, not ID, in table?
    ... But I tried started with the Control Wizard, ... > what table to open etc...but provide a nice menu that opens up a nice form. ... but display the suppler name. ... > a good idea for end users), then you have to use the query builder, and join ...
    (microsoft.public.access.gettingstarted)
  • Re: Have a Query use a Form?
    ... the reason your form should be based on a query and how to get ... designed table and then click the Autoform wizard on the toolbar. ... Then with the form in design view, tweak it more to your liking. ... Name the combobox something meaningful. ...
    (microsoft.public.access.gettingstarted)