Software and Component detail
_________________________________________
Microsoft visual studio 2010
MS .NET Framework
Version 4.0.30319 RTMRel
MYSQL SERVER Database
Version 5.5
MySQL Connector 6.6.4 64 Bit
MySQL ODBC Driver Version 5.2.a
Crystal Report for Visusl Studio 64 Bit 13.0.5
(CRforVS_redist_install_64bit_13_0_5)
Current Setup
_____________
1. I have WebSite in ASP.NET Visual Basic which works fine and is connected to MySQL Database, using MySQl Connector 6.6.4 64 bit
and is using a connection string,defined in web.confg.
2. I am using a Crystal report( It is very complex report, so cannot dare to redo it). Data Source for the report is set using a connection string
DRIVER={MySQL ODBC 5.2a Driver};SERVER=Licensedb;DATABASE=License;pwd=root;PORT=3306;OPTION=3 and this report is called from website using the below code
Dim crystalReport As ReportDocument = New ReportDocument()
Dim repPath As String = Server.MapPath("~/Reports/") + "LicenseReport.rpt"
crystalReport.Load(repPath)
CrystalReportViewer1.ReportSource = crystalReport
crystalReport.SetParameterValue("InstanceID", CInt(Session("sessionInstanceID")))
crystalReport.Refresh()
crystalReport.SetParameterValue("InstanceID", CInt(Session("sessionInstanceID")))
CrystalReportViewer1.Visible = True
3. The above setup works fine, when I run the website from Visual studio 2010. But when i use IIS 7, the aspx page having crystal report viewer control load and its blank.
However it work very well from studio it self.
4. So I changed the setup in point 2, by having a ODBC Data source defined. And changed the report accordingly. It work fine in Visual studio , but from IIS
it gives error "Failed to Open Connection, Failed to Open Connection <Crystal Report File name.rpt>"
5. I tried creating a System DSN and same connection string in IIS Application Connection string. But nothing changed.
Please can anyone point in correct direction. I must admit this is my first website development work, so I might have overlooked some minor details.
Any help would be much appreciated.
Hi , I am not sure how to do this. The only message I have is on the webpage failed to open connection. Please can you mention the steps to get the logs you asked for as I am very new to iis stuff. Thanks
dilpreetsoha...
0 Points
4 Posts
Visual Studio IIS, Failed to Open Connection when crystal report is called from website on IIS
Jan 22, 2013 09:11 PM|LINK
Software and Component detail
_________________________________________
Microsoft visual studio 2010
MS .NET Framework
Version 4.0.30319 RTMRel
MYSQL SERVER Database
Version 5.5
MySQL Connector 6.6.4 64 Bit
MySQL ODBC Driver Version 5.2.a
Crystal Report for Visusl Studio 64 Bit 13.0.5
(CRforVS_redist_install_64bit_13_0_5)
Current Setup
_____________
1. I have WebSite in ASP.NET Visual Basic which works fine and is connected to MySQL Database, using MySQl Connector 6.6.4 64 bit
and is using a connection string,defined in web.confg.
2. I am using a Crystal report( It is very complex report, so cannot dare to redo it). Data Source for the report is set using a connection string
DRIVER={MySQL ODBC 5.2a Driver};SERVER=Licensedb;DATABASE=License;pwd=root;PORT=3306;OPTION=3 and this report is called from website using the below code
Dim crystalReport As ReportDocument = New ReportDocument()
Dim repPath As String = Server.MapPath("~/Reports/") + "LicenseReport.rpt"
crystalReport.Load(repPath)
CrystalReportViewer1.ReportSource = crystalReport
crystalReport.SetParameterValue("InstanceID", CInt(Session("sessionInstanceID")))
crystalReport.Refresh()
crystalReport.SetParameterValue("InstanceID", CInt(Session("sessionInstanceID")))
CrystalReportViewer1.Visible = True
3. The above setup works fine, when I run the website from Visual studio 2010. But when i use IIS 7, the aspx page having crystal report viewer control load and its blank.
However it work very well from studio it self.
4. So I changed the setup in point 2, by having a ODBC Data source defined. And changed the report accordingly. It work fine in Visual studio , but from IIS
it gives error "Failed to Open Connection, Failed to Open Connection <Crystal Report File name.rpt>"
5. I tried creating a System DSN and same connection string in IIS Application Connection string. But nothing changed.
Please can anyone point in correct direction. I must admit this is my first website development work, so I might have overlooked some minor details.
Any help would be much appreciated.
Thanks
Dilpreet
nikunjnandan...
Participant
882 Points
223 Posts
Re: Visual Studio IIS, Failed to Open Connection when crystal report is called from website on II...
Jan 23, 2013 07:59 AM|LINK
Hiii,
It seems that in iis it's not working for you.
Please see below setting in your IIS.
Please set your website's application pool's Advance setting Enable32bitApplication = true.
Nikunj Nandaniya
My Blog
dilpreetsoha...
0 Points
4 Posts
Re: Visual Studio IIS, Failed to Open Connection when crystal report is called from website on II...
Jan 23, 2013 08:49 AM|LINK
Hi,
It did not work for me. any more suggestion please.
thanks
dilpreetsoha...
0 Points
4 Posts
Re: Visual Studio IIS, Failed to Open Connection when crystal report is called from website on II...
Jan 23, 2013 08:58 AM|LINK
Hi,
I think i must mention that I have MySQL ODBC Connector 32 bit and I have used C:\Windows\SysWOW64\odbcad32.exe to create my DNS.
If I use 64 bit MySQL ODBC Connector and configure ODBC, when using it in crystal report i get error
nikunjnandan...
Participant
882 Points
223 Posts
Re: Visual Studio IIS, Failed to Open Connection when crystal report is called from website on II...
Jan 23, 2013 10:21 AM|LINK
Hi,
Can you please pass me the exact exception with inner exception.
Write whole exception here. and at which line you got the error so we can have idea that there something wrong in odbc or in opening report.
If you are not getting line number then publish and upload dll with pdb files.
Nikunj Nandaniya
My Blog
dilpreetsoha...
0 Points
4 Posts
Re: Visual Studio IIS, Failed to Open Connection when crystal report is called from website on II...
Jan 23, 2013 12:04 PM|LINK
nikunjnandan...
Participant
882 Points
223 Posts
Re: Visual Studio IIS, Failed to Open Connection when crystal report is called from website on II...
Jan 23, 2013 01:05 PM|LINK
Hii,
As you say failed open connection it means there is something wrong in opening connection.
If there is problem in connection then your other stuffs must not work. Are your other stuffs working i mean insert,update,delete??
If still you want log then search on google how to write log in note.
See below link will help you.
http://www.asp.net/web-forms/tutorials/deployment/deploying-web-site-projects/processing-unhandled-exceptions-cs
http://www.codeproject.com/Tips/259139/Send-ASP-NET-formatted-errors-details-via-Email
Nikunj Nandaniya
My Blog