SqlCommand cmd = new SqlCommand("select distinct P.PartrowID from tbpanelparts P,tbParts PA where P.PartrowId=PA.ID and P.projid='"+Txt_prjid.Text+"' and P.partrowid not in (select ParentId from tbmakeup) and PA.supplierid="+Drp_supname.SelectedValue+"Union Select distinct(M.PartRowId) from tbMakeupproj MP,tbmakeup M,tbParts P where P.Id=M.PartRowId and MP.AssRowId=M.Rid and MP.ProjId='"+Txt_prjid.Text+"' and P.SupplierId="+Drp_supname.SelectedValue+"",connect.getConnection()); cmd.Connection.Open(); SqlDataReader dr = cmd.ExecuteReader(); if (dr.HasRows) { while (dr.Read()) { //List p=new List(); //p.Add((int)dr[0]); string a = dr[0].ToString(); SqlCommand cmd1 = new SqlCommand("Select C.CatName as ParentNm,P.CatName,P.PartNumber,n.TotQty,P.Price,P.SupplierId from tbParts P,tbCats C,(Select sum(CatQty) as TotQty from tbPanelParts PP,tbPanel PN where PN.Id=PP.PanelId and PN.Status='Checked' and PN.Projid='" + Txt_prjid.Text + "' and PP.PartRowId=" + p + " and PP.partrowid not in (select ParentId from tbmakeup)) as n where C.CatId=P.Parent and P.Id=" + p + "", connect.getConnection()); cmd1.Connection.Open(); SqlDataReader dr1=cmd1.ExecuteReader(); if (dr1.HasRows) { Grd_parts.DataSource = dr1; Grd_parts.DataBind(); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)