private DataSet GetDataItem() { String constr = Convert.ToString(ConfigurationManager.AppSettings["RptConnection"]); using (SqlConnection con = new SqlConnection(constr)) { using (SqlCommand cmd = new SqlCommand(@"select Invc.InvoiceNo,Ptm.PartyName,ptm.Address,invc.CreatedOn,invc.InvoiceGrandAmt,invc.DeliveryTerms,invc.InvoiceCurrency,invc.PaymentTerms,invc.TransShipment, invc.PartialShip, invc.Port, invc.DeliveryType, invc.Unit from tblInvoice invc join tblPartyMaster ptm on invc.PartyNo = ptm.PartyCode where invc.InvoiceNo = '" + txthiddenInvoiceNum.Text + "'")) { using (SqlDataAdapter sda = new SqlDataAdapter()) { cmd.Connection = con; sda.SelectCommand = cmd; DataSet ds = new DataSet(); using (PerformaInvoice dsCustomers = new PerformaInvoice()) { sda.Fill(ds); return(ds); } } } } }
private DataSet GetDataItemDetails() { String constr = Convert.ToString(ConfigurationManager.AppSettings["RptConnection"]); using (SqlConnection con = new SqlConnection(constr)) { // using (SqlCommand cmd = new SqlCommand("select ArtNo,UPPER(ArtDesc) As ArtDesc, UPPER('REFILL INK : ' + RefileInk) as RefileInk,Rate,Quantity,Amount from tbl_InvoiceItemDetails where InvoiceNo = '" + txthiddenInvoiceNum.Text + "'")) //{// using (SqlCommand cmd = new SqlCommand("select ArtNo,UPPER(ArtDesc) As ArtDesc, UPPER('REFILL INK : ' + RefileInk) as RefileInk,Rate,Quantity,Amount from tbl_InvoiceItemDetails where InvoiceNo = 'SSB-3'")) { using (SqlDataAdapter sda = new SqlDataAdapter()) { cmd.Connection = con; sda.SelectCommand = cmd; DataSet ds = new DataSet(); using (PerformaInvoice dsCustomers = new PerformaInvoice()) { sda.Fill(ds); return(ds); } } } } }