How can I pass parameter to Typed Dataset in VB.Net 2005?

L

Luqman

I have created a typed dataset and data adapter at design time in XSD File,
and created a parameter.

For example:

Select * from customers where CustomerID=@custid

Now how can I pass the parameter "ALFKI" at runtime.

I searched the internet which says,

myAdapter.SelectCommand.Parameters("@custid").value="ALFKI"

but there is no SelectCommand shows after myAdapter. ?

What am I missing ?

I am using VB.Net 2005.
 
L

Larry Lard

Luqman said:
I have created a typed dataset and data adapter at design time in XSD File,
and created a parameter.

For example:

Select * from customers where CustomerID=@custid

Now how can I pass the parameter "ALFKI" at runtime.

I searched the internet which says,

myAdapter.SelectCommand.Parameters("@custid").value="ALFKI"

but there is no SelectCommand shows after myAdapter. ?

What am I missing ?

I am using VB.Net 2005.

In the visual Dataset Designer, right click the Customers tableadapter,
and choose Add | Query... and follow the wizard through, providing your
SQL statement where prompted. This will create methods named (by
default) FillBy and GetDataBy on the TableAdapter, which will take
arguments corresponding to the parameters in the SQL statement. There's
good examples in the documentation, I believe.
 
C

Cor Ligthert [MVP]

Luqman,

Go to the solution explorere
Change in top the icon show all files to show all files.
Have than a look at your typed dataset in that and especially that with the
extention .vb
That is the Strongly Typed Dataset that the designer created

(In windowforms by the way)

I hope this helps,

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top