Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. unable to get appropriate data from access database to crystal report in C#

unable to get appropriate data from access database to crystal report in C#

Scheduled Pinned Locked Moved C#
csharpdatabasehelp
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    aashish saalvi
    wrote on last edited by
    #1

    hi i am trying to retrieve data from access databases multiple tale into a dataset, with dataset iam trying to populate the crystal report of C#. but after doing all this procedure the data is displayed multiple times. i dont know where i have gone wrong. can any one help me out of this. the code written is as follows namespace ContractSystem { public partial class ViewPSDClrdReport : Form { OleDbConnection con; OleDbDataAdapter da,da1; OleDbCommand cmd,cmd1; OleDbDataReader rd,rd1; DataSet ds; DataTable dt; PSDClrdCrystalReport rpt; string str1, str2, str3,str4; public ViewPSDClrdReport(string s1,string s2,string s3) { InitializeComponent(); str1 = s1; str2 = s2; str3 = s3; } private void ViewPSDClrdReport_Load(object sender, EventArgs e) { crystalReportViewer1.DisplayGroupTree = false; try { con = new OleDbConnection("Provider=Microsoft.Jet.Oledb.4.0; Data Source=e:/Ashish/Practice/ContractSystem/ContractSystem/ContractSystemDB.mdb"); con.Open(); ds = new DataSet(); rpt = new PSDClrdCrystalReport(); if (str3 == "All") { cmd = new OleDbCommand("select PrNo from PSDApproval where FwdDtByPSD between '" + str1 + "' and '" + str2 + "'", con); rd = cmd.ExecuteReader(); if (rd.HasRows) { while (rd.Read()) { str4 = rd.GetString(0); da = new OleDbDataAdapter("select PrNo,Description,ValueQuoted,PurchaseGrp,RcdDtEA,FwdDtPSD,Initial from InitialApproval where InitialApproval.PrNo='" + str4 + "'", con); da.Fill(ds, "InitialApproval"); da.Dispose(); da1 = new OleDbDataAdapter("select EstimatedVal,FwdDtByPSD from PSDApproval where PSDApproval.PrNo='" + str4 + "'", con); da1.Fill(ds, "PSDApproval"); da1.Dispose(); MessageBox.Show("ALL ADDED"); } } //rpt.SetDataSource(ds); }

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups