protected void BindGvorder2() { string strSelectCmd = @" select p.pCADId,b.ord_no,b.art_no,b.art_qty,b.byr_nm,b.bCADCons,p.pCADCons,b.bCADDia,p.pCADDia,b.bCADGsm,p.pCADGsm,p.cadApproved,p.cadCanceled from tblBookCAD b join tblProdCAD p on b.ord_no = p.ord_no and b.art_no = p.art_no where p.cadApproved is not null "; SqlDataAdapter da = new SqlDataAdapter(strSelectCmd, conn); //conn.Open(); DataSet ds = new DataSet(); da.Fill(ds); if (ds.Tables[0].Rows.Count == 0) { ds.Tables[0].Rows.Add(ds.Tables[0].NewRow()); Gvorder2.DataSource = ds; Gvorder2.DataBind(); int columncount = Gvorder2.Rows[0].Cells.Count; Gvorder2.Rows[0].Cells.Clear(); Gvorder2.Rows[0].Cells.Add(new TableCell()); Gvorder2.Rows[0].Cells[0].ColumnSpan = columncount; Gvorder2.Rows[0].Cells[0].Text = ""; } else { Gvorder2.DataSource = ds; Gvorder2.DataBind(); } }
protected void BindGvorder2() { string strSelectCmd = " select * FROM View_PO_Buyer WHERE ActiveOrder='1' AND Po_ShipDate IS NULL AND TnAapproved IS NOT NULL order by TnAapproved DESC "; SqlDataAdapter da = new SqlDataAdapter(strSelectCmd, conn); //conn.Open(); DataSet ds = new DataSet(); da.Fill(ds); if (ds.Tables[0].Rows.Count == 0) { ds.Tables[0].Rows.Add(ds.Tables[0].NewRow()); Gvorder2.DataSource = ds; Gvorder2.DataBind(); int columncount = Gvorder2.Rows[0].Cells.Count; Gvorder2.Rows[0].Cells.Clear(); Gvorder2.Rows[0].Cells.Add(new TableCell()); Gvorder2.Rows[0].Cells[0].ColumnSpan = columncount; Gvorder2.Rows[0].Cells[0].Text = ""; } else { Gvorder2.DataSource = ds; Gvorder2.DataBind(); } }