Hi There,
This is my code. I'm pretty sure that theres nothing wrong so far with this code. But gives me an unexpected error. The error says, Invalid column name 'Sep'. But, even through out the whole code, nor on the database theres any column or word called, 'Sep'. So what does this error mean and whats the quickest solution? Appreciate anyone who can help me with this.
conn.Open();
SqlCommand sql1 = new SqlCommand();
sql1.Connection = conn;
sql1.CommandType = CommandType.Text;
sql1.CommandText = "Select SalesOrder.OrderNo, SalesOrder.CustCode, Customer.CustName, SalesOrder.OrderDate, SalesOrder.ExpDelDate, SalesOrder.ActDelDate, SalesOrder.OrderAmt, (SalesOrder.OrderAmt-SalesOrder.OrderCost)/SalesOrder.OrderAmt*100 AS GM, SalesOrder.RepCode, SalesOrder.StatusCode, SalesOrder.UserName, Rep.RepName, SalesOrder.StatusDesc From SalesOrder, Customer, Rep Where SalesOrder.OrderDate = " + lblDate.Text + " ";
DataSet ds1 = new DataSet();
SqlDataAdapter da1 = new SqlDataAdapter(sql1);
da1.Fill(ds1,"report");
lblDate.Visible = true;
GridView1.Visible = true;
GridView1.DataSource = ds1;
GridView1.DataMember = "report";
conn.Close();
Thanx.
Cheers.
AZ.