cancel
Showing results for 
Search instead for 
Did you mean: 

Visual Studio 2012 C# and SQL 2008 SP2

Former Member
0 Kudos

I'm running VS 2012 C# and SQL 2008 SP2.  I'm getting an logon error in my Crystal Report Window Forms Viewer "Logon Failed".  The report prompts the user to enter the logon information.  Some reports work some don't.  I'm using the following code to access the my database.

myReport.SetDatabaseLogon(ReportingUserId, ReportingPassword, ReportingServer, ReportingDB);

the error pops up.  I've also tried:

Tables tables = reportName.Database.Tables;

           

foreach (CrystalDecisions.CrystalReports.Engine.Table table in tables)

            {

        TableLogOnInfo tableLogInInfo = table.LogOnInfo;

                tableLogInInfo.ReportName = "Bill of Sale";
                tableLogInInfo.ConnectionInfo.ServerName = ReportingServer;

                tableLogInInfo.ConnectionInfo.DatabaseName = ReportingDB;

                tableLogInInfo.ConnectionInfo.UserID = ReportingUserId;

                tableLogInInfo.ConnectionInfo.Password = ReportingPassword;

                table.ApplyLogOnInfo(tableLogInInfo);

            }

Any help would be great!

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

Hello Terence

To state the obvious, since some reports work and others do not, the way to approach this is to determine the differences. For starters, these may be:

1) Subreports (if a subreport uses teh same connection, it will usually piggy back on the main report connection - I would not rely on this though and code the connection for the subreport irrespective)

2) Type of connection (e.g.; some reports may use OLE DB, others ODBC, others native...)

3) Type of client (for example MS SQL, some reports may be using native 10, others may be using lower version client)

I'd also recommend looking at the following:

Troubleshooting Guide to Database Connectivity Issues with Crystal Reports in Visual Studio .NET App...

Troubleshooting Database Connectivity for Crystal Reports

- Ludek

Senior Support Engineer AGS Product Support, Global Support Center Canada

Follow us on Twitter

Got Enhancement ideas? Try the SAP Idea Place

Share Your Knowledge in SCN Topic Spaces

Former Member
0 Kudos

Thank you for the fast reply.

All of my reports are connecting one of the two ways described above.  Most use the second example and some of those work some don't.  I can't find a rhyme or reason why some work and others don't. 

Some report use subreports most of the reporst us anywhere between 1 to 3 tables to produce the report.  They all us SQL 2008 SP2.  I application uses an OLEDB connection and I pass that connection through out my applicaiton.  I use a specail logon for reports only.  As described above.

I hope that clears up my set up

0 Kudos

What SDK are you using?

CR for VS 2012 SP 6 supports VS 2012, no previous SP supports VS 2012.

Also, the DB client dll should be MS SQL Native 11 driver, sqlncli11.dll

Ms does not fully support MDAC OLE DB Provider.

Don.

Former Member
0 Kudos

Don

Thanks for the reply.

I installed CRforVS_redist_install_32bit_13_0_6 by sql is 2008 SR2 and I'm still getting teh same error.

Your comment about the sql driver I looked on  my development machine and I didn't see any sql dll's.  Where would this dll be located and should I put on the my test machine also.

The crazy part of my issue is some of my reports work and some don't.  I'm using the SetDatabaseLogon that is provided by Crystal Reports.  I'm at a loss.  My options are running out I may have to dump crystal reports for something that i have more control over.

0 Kudos

Um, you have to install the first link to integrate into VS IDE. Redist is for deployment only.

SQL 2008/2012 client instlal is from the SQ CD - client tools.

Reports hould be udpated to use that driver also.

If you want to get it going I suggest you create a case in Service Maket Place or if no contract then purchase a single and a Rep will get this goign for you. You can search for crlogger and enable our DB logging as well as crpe32 logging to see what is happening.

Assuming you are not changing DB Servers then logging on should do it, it you are changing servers the search for ReplaceConnection and you'll find sample code on how to.

Don

Answers (0)