SqlDataAdapter Not working with parameters from C#
Hi,
I build a SqlDataAdaptor in VS2003 and I am trying to get a set of records from a table using a stored procedure. I have tested the stored procedure and it generates the correct data. I have also tested the dataadaptor and it seems to work just fine. However, when I work it from C# I get an empty dataset. (Also, the dataset was built using VS as well).
Here is the code. Can any one tell me what is wrong here?
this.sqlDataAdapter3.SelectCommand.Parameters["@NameID"].Value = 1;
this.sqlDataAdapter3.Fill(dsDNames);
foreach(DataRow row in dsDNames.TraningDates.Rows)
{
Console.WriteLine(row[1]);
}
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

jesuprakash2 reputationPosted Apr 12, 2005, 5:30 AM EDT
mjsnow3 reputationPosted Apr 12, 2005, 7:35 AM EDT