I have a ASP.NET web page that needs to make a SQL Server call from the client side in a script sectipn of my aspx file. I'm calling a stored proc which takes one parm. This sp works fine in SQL Server Management Studio returning records as expected. When I try to fill a dataset from a call to this sp the ds gets filled with zero records. Is there something about making this call from the client side which I'm missing. Here is my code. I'm hard coding the parm for test purposes. PS - I have this in a try catch and get no errors just an empty dataset.Thnx.
string strAssignedTo = "Dwight Shoemaker";
System.Data.DataSet ds = new System.Data.DataSet();
System.Data.SqlClient.SqlConnection sqlcon = new System.Data.SqlClient.SqlConnection("Data Source=sql394.mysite4now.com;Initial Catalog=ULS_db1;User ID=uls2008;Password=uls2008");
System.Data.SqlClient.SqlCommand comand = new System.Data.SqlClient.SqlCommand();
comand.Connection = sqlcon;
comand.CommandText = "GetAssignedToReport";
comand.CommandType = System.Data.CommandType.StoredProcedure;
comand.Parameters.Add(new System.Data.SqlClient.SqlParameter("@assignedTo", System.Data.SqlDbType.VarChar, 50));
comand.Parameters["@assignedTo"].Value = strAssignedTo;
System.Data.SqlClient.SqlDataAdapter sqladp = new System.Data.SqlClient.SqlDataAdapter(comand);
sqlcon.Open();
sqladp.Fill(ds);