Solved

query ?

Posted on 2015-02-24
2
168 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
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Javascript to set controls visibility 5 36
Formula problem with Excel attachment 6 27
Sub or Function is not defined 6 30
vb.net and creating a class 5 17
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
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 …

777 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