following is my code...
public DataSet Admininformsale()
{
try
{
SetConnection();
sql_con.Open();
sql_cmd = sql_con.CreateCommand();
string CommandText = "select Category,Compname,TDiscount,City,Area,Venue,DetailsOfDiscount,Emailid,Convert(char(8),SDate,10)as SDate,Convert(char(8),EDate,10) as EDate from offsale.OS_Informsale where Approval='False' and datediff(day,EDate,getdate())<=0 order by Category";
da = new SqlDataAdapter(CommandText, sql_con);
DataSet ds = new DataSet();
da.Fill(ds);
return ds;
}
catch (Exception ex)
{
return null;
}
private DataTable AdminInformshow()
{
My_Util Util = new My_Util();
try
{
SqlCommand sql_cmd;
SqlDataAdapter da;
Util.SetConnection();
sql_cmd = Util.sql_con.CreateCommand();
string CommandText = "select Category,Compname,TDiscount,City,Area,Venue,DetailsOfDiscount,Emailid,CONVERT(CHAR(8),SDate,10)as SDate,CONVERT(CHAR(8),EDate,10) as EDate from offsale.OS_Informsale where Approval='False' and datediff(day,EDate,getdate())<=0 order by Category";
da = new SqlDataAdapter(CommandText, Util.sql_con);
DataTable dt = new DataTable();
da.Fill(dt);
return dt;
}
catch (Exception ex)
{
return null;
}
}