Platform: WinXP Pro
If you're using the OleDbDataAdapter, most probably you have drag&dropped it in a form. Right-click it and select Configure Data Adapter. In the dialog for the SQL statement, enter something like the following:
SELECT * FROM Employees WHERE SSN=@SSNThe code to fill the dataset should be:
oleDbDataAdapter1.SelectCommand.Parameters.Add("@SSN", this.txtSSN.Text); oleDbDataAdapter1.Fill(dataSet1);
This way you're passing the SSN parameter to the query before filling the dataset.
Dig Deeper on Win Development Resources
Related Q&A from Daniel Cazzulino
Here Daniel Cazzulino explains how to load a DSL (domain specific language) domain model instance file programmatically. This requires the .NET type ... Continue Reading
Here we offer a glimpse at 12 of .NET development expert Danny Cazzulino's top ASP.NET questions and answers. Continue Reading
C# developers should NOT be modifying InitializeComponent method in the code-behind (or any of the variable definitions) by hand. Continue Reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.