public void displayDataGridView()
{
SqlCommand cmd = new SqlCommand("Select ROW_NUMBER() over(ORDER BY Billno ASC) as ID, Billno, Customer_Details.CustName, Date,Amount, Tax_Amount, Total_Amount from MainBillForm join Customer_Details on MainBillForm.Name=Customer_Details.CustID where Sno=0 ", con);
try
{
con.Open();
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = cmd;
DataTable dt = new DataTable();
da.Fill(dt);
dataGridView1.DataSource = dt;
con.Close();
}
catch (Exception ec)
{
MessageBox.Show(ec.Message);
}