Re: changing a datasets contents



You will be able to.

Once you setup a query / table adapter with a "@Filter"
then when you call your tableadapter, it takes in parameters....

Create a new project, a dummyhelloworld,
attach a dummy dataset,
right click in the dataset table, and add a new table adapter,
take the table adapter and add a filter,
Nameit something like "helloworldtest"

on the form, when you "drag and drop" the fields on the form, go to the code, and look for the tableadapter.
Change the tableadapter that was added to the one you just created "helloworldtest"...
you should see what I mean with the parameters being passed into it.

If you need some screenshot examples - I can create some for you - let me know.

Miro

"Heath P. Dillon" <Heath@xxxxxxxxxxxxx> wrote in message news:D99EC750-08F7-4128-9ABF-51E1A03ED2B3@xxxxxxxxxxxxxxxx
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: changing a datasets contents
    ... The problem I have is that I want to be able to change the value in my select statements where clause in my code. ... I can't seem to find any way to access the select statement that I created in the table adapter, nor understand how the parameter I created links to this query. ... on the form, when you "drag and drop" the fields on the form, go to the code, and look for the tableadapter. ...
    (microsoft.public.dotnet.languages.vb)
  • TableAdapter approach
    ... I'm starting an application using a TableAdapter instead of direct sql ... In my table adapter there's already an stored procedure that returns ... Now, I added another query, but now I need it to return columns b, c, ... it if that's the correct desire. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Table adapter
    ... Why do you want to use the same table adapter? ... When I try to add a query to a Tableadapter in a Typed Dataset, ... "command text returns data with schema different from ...
    (microsoft.public.dotnet.languages.csharp)
  • Can anyone help with Data Designer issue?
    ... database from the TableAdapter, it returns rows. ... debug what the command is sending to the Access database for any particular ... This query uses parameters and I'm afraid it's not sending the where clause ...
    (microsoft.public.dotnet.framework.adonet)
  • SUMMARY: Sun Fire V480 and ce.conf for Onboard Ethernet Interfaces
    ... The problem was in the documentation (cited below, in the original query). ... > adapter is installed, just the RSC adapter in the RSC slot, which I'm not ... > The problems start when I try to configure just ce0, ... > since ndd commands for the ce driver in rcX.d scripts is not supported by ...
    (SunManagers)

Loading