mjsnow

mjsnow

  • NA
  • 3
  • 0

SqlDataAdapter Not working with parameters from C#

Apr 4 2005 1:45 PM
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]); }

Answers (2)