Hi,
i have an error in convert function?.i am underlying the error part.can u please rectify this problem.Please do the needful.
Error:-Incorrect syntax near the keyword 'convert'.
public void reportsgridview()
{
SqlConnection con = new SqlConnection("data source=mars-104;initial catalog=marsweb;integrated security=true");
SqlCommand cmd = new SqlCommand("select invoiceno,orderno convert(varchar(15),ondate,105),convert(varchar(15),invoicedate,105),netamount,netvat,tamount from tbl_report2", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
con.Open();
da.Fill(dt); if (dt.Rows.Count > 0)
{
GridView1.DataSource = dt;
}
else
{
}
}
Best,
Sudheep.