DataTable dt5 = new DataTable(); string CS = ConfigurationManager.ConnectionStrings["DBCS"].ConnectionString; using (SqlConnection con = new SqlConnection(CS)) { string sqlstr5 = "select ipd.FK_Product_id,pt.Product_name,iph.FK_Store_id ,st.Store_name,iph.Invoice_Date,ipd.QTY,ipd.TotalInvoice from InvoicePurchaseHead as iph inner join StoresTBL as st on st.Store_id=iph.FK_Store_id inner join InvoicePurchaseDetails as ipd on ipd.FK_Customers_id=iph.FK_Customers_id inner join Products_TBL as pt on pt.Product_id=ipd.FK_Product_id WHERE ipd.FK_Product_id = @FK_Product_id and iph.Invoice_Date = DATEADD(DAY, DATEDIFF(DAY, 0, GETDATE()), 0)"; using (SqlDataAdapter dr7 = new SqlDataAdapter(sqlstr5, CS)) { dr7.SelectCommand.Parameters.AddWithValue("@FK_Product_id", txtProductId.Text ); dr7.Fill(dt5); dataGridView1.DataSource = dt5; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)