Solved

query ?

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
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…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

757 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now