0

I am using Visual Studio 2012 Ultimate , MySql Database , MySQL ODBC 5.1 Driver
I have created a user DSN from Administrative tool in Control Panel (same on both my development PC and Server computer i-e Windows Server 2008)
I have deployed web application from my PC to Server using IIS 7.0 and when i access it from remote computer through,then crystal report asks for login parameters and don't accept crdentials.
i am using the following code.

    string databaseName = "hr";
    string serverName = "192.168.137.6";
    string userID = "userID";
    string pass = "password";
protected void btn_search_Click(object sender, EventArgs e)
    {
        CrystalReportViewer1.Visible = true;
         ReportDocument reportDocument = new ReportDocument();
        string reportPath = Server.MapPath(@"~/GeneralEmpReports/test.rpt");
        reportDocument.Load(reportPath);

        reportDocument.SetDatabaseLogon(userID, pass, serverName, databaseName);
        reportDocument.SetParameterValue("D", tbx_ddoCode.Text.ToUpper());
        CrystalReportViewer1.ReportSource = reportDocument;
    }
1
Contributor
1
Reply
11
Views
2 Years
Discussion Span
Last Post by KhuramJan
0

After alot searching i came to the solution,
Server Name = You DSN Name not IP Address

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.