Posts

Showing posts with the label connection

How to resolve "Logon Failed" Error in crystal report

Image
Hi friends, Crystal report is a rich tool of reporting and analysis.when you setup in win application.it works good in development side.but when setup in deployment side come this logon fail error. This error come because crystal report set database connection in report data.and when we change database location or change server then crystal report can't connect with database.so this error come to user. for solution this problem need some code for resolve this issue.this call set login detail to crystal report. //create ReportDocument CrystalDecisions.CrystalReports.Engine.ReportDocument cryRpt = new CrystalDecisions.CrystalReports.Engine.ReportDocument(); //ConnectionInfo ConnectionInfo info = new ConnectionInfo(); //set database server name info.ServerName = Server name; //set database userid info.UserID = userid; //set database password info.Password = password; //set database IntegratedSecurity info.IntegratedSecurity = false; //set report used data...

Create class for Access database connection

Image
Hello to all,      Here we make on class that help to connect application's database by simply call class.          First we create Win form application .like Testapp. create one Access database like Testapp.accdb. after that we open application in visual studio and create one folder that name app_code. in this folder add one class file.and name them dbhelper.cs. public class DbHelper     {         public static OleDbConnection dbConnection;         public DbHelper()         {             dbConnection = new OleDbConnection("Provider=Microsoft.Ace.OLEDB.12.0; Persist Security Info = False; Data Source=c:\\Testapp.accdb");             dbConnection.Open();         } } For this code you need to include some libraries like System.Data.OleDb ; Now time to use this c...