?
Solved

query ?

Posted on 2015-02-24
2
Medium Priority
?
175 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 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

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

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

Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Starting up a Project
Suggested Courses

770 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