Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
I create a crystal report, which show data from two tables(MSAccess)....
When i run the form in my PC its good and show the records.. when i run it on other PC the Database Login dialog box appear.Its want LoginID and password but I don't give any password in the database... If I click finish button it shows Logon failed. Please Try again.
My C# code is -:
OleDbConnection con=new OleDbConnection("Provider=Microsoft.jet.oledb.4.0; data source="+Application.StartupPath+@"\DataInfo1.mdb;");           
            con.Open();
           OleDbDataAdapter da=new OleDbDataAdapter("SELECT * FROM salesitemdetails WHERE bill_no in(SELECT bill_no FROM salesdetails WHERE custid in( SELECT custid FROM custdetails where custarea='"+ this.textBox1.Text.Trim() +"' order by custid))",con);
           DataSet ds = new DataSet();
           da.Fill(ds);
           CrystalReport1 cr = new CrystalReport1();
           cr.SetDataSource(ds);
           cr.SetDatabaseLogon("Admin", "");
            this.crystalReportViewer1.ReportSource = new CrystalReport1();
            this.crystalReportViewer1.Show();
 
How to fix it ??
 

Every Help will be Appreciate....
Posted 3-Mar-13 1:30am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You can refer to this URL:
Sample code
 
Please use this connection string: Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\mydatabase.mdb;User Id=admin;Password=;
  Permalink  
v2
Comments
Jayanta Chatterjee at 5-Mar-13 21:57pm
   
Sir,I want it in winform not ASP.NET..
jerrykid at 9-May-13 4:14am
   
Maybe the connection is missing, I updated the connection string, pls try it.
Jayanta Chatterjee at 9-May-13 9:04am
   
I try it but it doesn't worked ....
thanks for reply, I solved it with dataSet control....

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 575
1 Kornfeld Eliyahu Peter 409
2 Maciej Los 369
3 DamithSL 196
4 OriginalGriff 188
0 OriginalGriff 6,353
1 DamithSL 4,854
2 Maciej Los 4,476
3 Kornfeld Eliyahu Peter 4,058
4 Sergey Alexandrovich Kryukov 3,917


Advertise | Privacy | Mobile
Web02 | 2.8.141220.1 | Last Updated 9 May 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100