Click here to Skip to main content
15,885,757 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Below is my code,I am not able to retrieve the data and store it in the Dataset ds, I am a beginner so don't know how to solve this.




public static DataSet GetTestDetails(string testVariable)
{

SqlConnection sqlConn = new SqlConnection();
sqlConn.ConnectionString = ConfigurationManager.AppSettings["connTestConn"];
SqlParameter parameter1 = null;
try
{
parameter1 = new SqlParameter("@TestVariable", SqlDbType.VarChar);
parameter1.Value = testVariable;
DataSet ds = SqlHelper.ExecuteDataSet(sqlConn, "TestStoredProcedure", parameter1);
return ds;
}
finally
{
parameter1 = null;

if (sqlConn != null && sqlConn.State == ConnectionState.Open)
{
sqlConn.Close();
}
}

}


thanks in Advance :)
Posted

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900