Dropdownlist
-
Hi.. I have stored procedure to display listofdays by using year and month.My Storedprocedure filter all the Listofdays by leapyear and by month it will display listofdays. In my stored procedure i used two parameters month & Year.I want to bind lisofdays spro in code behind with two parameters and how i call this listofdays method to my dropdownlist?? I am using below methods for binding the data into datatable. Getdatatable Method
sqlconn = GetConnection();
cmd.Connection = sqlconn;
da = new SqlDataAdapter(cmd);
dt = new DataTable();
da.Fill(dt);return (dt);
Calling My Spro
cmd = new SqlCommand("ndi_sp_GetDaysOfMonth", sqlconn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add(new SqlParameter("@Month",DbType.Int16));
cmd.Parameters.Add(new SqlParameter("@Year", DbType.Int16));return GetDataTable(cmd);
The method is correct.??If so when i put breakpiont and checking its not filling the data in datatable.:confused: Hope someone reply to my message..Thanks in advance
-
Hi.. I have stored procedure to display listofdays by using year and month.My Storedprocedure filter all the Listofdays by leapyear and by month it will display listofdays. In my stored procedure i used two parameters month & Year.I want to bind lisofdays spro in code behind with two parameters and how i call this listofdays method to my dropdownlist?? I am using below methods for binding the data into datatable. Getdatatable Method
sqlconn = GetConnection();
cmd.Connection = sqlconn;
da = new SqlDataAdapter(cmd);
dt = new DataTable();
da.Fill(dt);return (dt);
Calling My Spro
cmd = new SqlCommand("ndi_sp_GetDaysOfMonth", sqlconn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add(new SqlParameter("@Month",DbType.Int16));
cmd.Parameters.Add(new SqlParameter("@Year", DbType.Int16));return GetDataTable(cmd);
The method is correct.??If so when i put breakpiont and checking its not filling the data in datatable.:confused: Hope someone reply to my message..Thanks in advance
The obvious question is, is your stored proc correct? Is the SqlCommand being executed properly but no data is being returned? Seems critical thinking and debugging skills are a lost art.
only two letters away from being an asset
-
The obvious question is, is your stored proc correct? Is the SqlCommand being executed properly but no data is being returned? Seems critical thinking and debugging skills are a lost art.
only two letters away from being an asset
Yes..I Tested and executed my spro.Its working.When i am adding parameter values year and month..its displaying listofdays according to month and year.
-
Yes..I Tested and executed my spro.Its working.When i am adding parameter values year and month..its displaying listofdays according to month and year.
Ok, so what else could you test? Apply some thought processes. It will develop your skills and may lead to an answer without having to ask people to solve it for you.
only two letters away from being an asset