Jyoti Jodha

Jyoti Jodha

  • NA
  • 1.7k
  • 408.2k

How to get all the details of particular bill in another win

May 4 2017 5:12 AM
How to get all the details of particular bill in another window when I double click the row of grid view....
 
 
 
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);
}
 
 
 

Answers (5)