Skip to content

Instantly share code, notes, and snippets.

@sajjadjaved01
Created January 12, 2018 09:38
Show Gist options
  • Save sajjadjaved01/968838d0b6bd1e51134b53f12c657cd5 to your computer and use it in GitHub Desktop.
Save sajjadjaved01/968838d0b6bd1e51134b53f12c657cd5 to your computer and use it in GitHub Desktop.
report
{
var con = new MySqlConnection(
"server=localhost;userid=root;password=admin;database=POS_DB;persistsecurityinfo=True;");
var cmd = new MySqlCommand(
"Select DISTINCT Sales.InvoiceNo, Sales.CustomerID, Sales.GrandTotal, Sales.TotalPayment, Sales.PaymentDue, Sales.InvoiceDate, ProductSold.ConfigID, ProductSold.ProductName, ProductSold.Quantity, ProductSold.Price, ProductSold.TotalAmount " +
"From ProductSold, Sales, Branch " +
"Where Sales.InvoiceNo='INV-559216' And branch.BranchID='1'", con);
var sqlData = new MySqlDataAdapter { SelectCommand = cmd };
sqlData.Fill(set, "Sales");
sqlData.Fill(set, "ProductSold");
sqlData.Fill(set, "Branch");
var receipt = new SaleRecipt();
receipt.Refresh();
receipt.SetDataSource(set);
RptViewer.Instance.crystal.ReportSource = receipt;
RptViewer.Instance.ShowDialog();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment