Posts

Showing posts from October, 2016

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...

How to get month days count from date or month and year

Hi all . Window form application need some calculation of date and days,so require no of days in current month or any date of month. So for that we use on c# in build function to get days count. System.DateTime.DaysInMonth(Year(int), Month(int)); This function output number of days in integer. And we need to input year and month number in integer value. If you have date then we get month and year from it. DateTime NowDate = new DateTime(); int iMonth=NowDate.Month; int iYear=NowDate.Year; If you have month name so need to get number of month int iMonth=DateTime.ParseExact("MonthName", "MMMM", CultureInfo.InvariantCulture).Month For this code need to include using System.Globalization; library. Thanks to read this post. comment if any problem in code.