what is the problem with this code in c#

Jul 27 2012 8:43 AM

hello friends
       
        this is my code to get data from database table.

try
{
Dob.open();
SqlCommand cmd6 = new SqlCommand("sp_combo1", Dob.con);
cmd6.CommandType =
CommandType.StoredProcedure;
SqlDataAdapter sda = new SqlDataAdapter();
sda.SelectCommand = cmd6;
DataSet ds = new DataSet();
sda.Fill(ds);
DataTable dt = ds.Tables["Acadamic_year"];
return dt;
What is the error in this code.dateset does not getting table from database.   































































Answers (4)