[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

query ?

Posted on 2015-02-24
2
Medium Priority
?
180 Views
Last Modified: 2015-02-25
vb.net, vs2012, sql server database
Here's my code: SQL Select Command:

SELECT        str_CustID, str_CstPrtsPriceCrgd, str_CstExtWarrDesc, str_CstExtWarrMonths, str_CstExtWarrMiles, str_CstExtWarrDeduct
FROM            CstPrtsPricing_ETC
WHERE        (str_CustID = @str_CustID)

This query is positioned under "MyDatabase", "MyDataSet", "MyTableAdapter" and I want to call this Query (and pass the variable, "@str_CustID" obviously), and run the query.

Could anyone help with the command from a save button?
0
Comment
Question by:MBHEY131
1 Comment
 
LVL 32

Accepted Solution

by:
Daniel Wilson earned 2000 total points
ID: 40630428
This query is positioned under "MyDatabase", "MyDataSet", "MyTableAdapter"

I'm not sure I understand what you mean by that phrase.  Shall I assume that MyDatabase is a SqlConnection, MyDataSet a DataSet, and MyTableAdapter a SqlDataAdapter?

And you're interested in filling the dataset from MyTableAdapter, right?

How does this come out for you?

MyTableAdapter.SelectCommand.Parameters.Clear();
MyTableAdapter.SelectCommand.Parameters.Append(New SqlDataParameter("@str_CustID", SomeValue);
MyTableAdapter.Fill(MyDataSet);

Open in new window


Documentation of some of these classes is at https://msdn.microsoft.com/en-us/library/System.Data.SqlClient.SqlDataAdapter(v=vs.110).aspx
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Progress

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question