Solved

query ?

Posted on 2015-02-24
2
173 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 32

Accepted Solution

by:
Daniel Wilson earned 500 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

Technology Partners: 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

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …

724 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