private void show_valueInDGVItems()
{
Int32 CustomerID;
CustomerID = Convert.ToInt32(label_Custmer_ID.Text);
string query3 = "select * from Table_InvoiceItem WHERE CustomerID=@parameter1";
using (SqlConnection con3 = new SqlConnection("Data source=INVENTOR-6FBADA\\SQLEXPRESS;Initial Catalog=AnindyaCD;Integrated Security=SSPI"))
{
using (SqlCommand cmd3 = new SqlCommand(query3, con3))
{
cmd3.Parameters.AddWithValue("@parameter1", CustomerID);
using (SqlDataAdapter ad = new SqlDataAdapter(query3, con3))
{
ad.SelectCommand = cmd3;
DataSet ds = new DataSet();
ad.Fill(ds, "Table_InvoiceItem");
dataGridView_showItemtoSell.DataSource = ds.Tables[0];
}
}
}
}
|