Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7814749
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T05:17:36+00:00 2026-06-02T05:17:36+00:00

Please see the below code. I think it’s pretty self explanatory. I’m running VS2010

  • 0

Please see the below code. I think it’s pretty self explanatory. I’m running VS2010 along with Crystal Reports for VS2010. Crazy thing is I have a similar project with similar code which doesn’t generate an exception on that line…so I’ve been trying to figure out the difference between the two projects but have came up empty so far.

Thanks for any advice or ideas on how to fix this!

using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using CrystalDecisions.Shared;
using CrystalDecisions.CrystalReports.Engine;

public partial class Reports : System.Web.UI.Page
{
  ReportDocument rptSP;


protected void Page_Load(object sender, EventArgs e)
{
   rptSP = new ReportDocument();
   string rptPath = Server.MapPath(Request.QueryString["rptname"].ToString());
   rptSP.Load(rptPath, 0);
   rptSP.DataSourceConnections["MyServer\\MyInst", "MyDB"].SetConnection("MyServer\\MyInst", "MyDB", "MyUsername", "MyPass");
//The above line causes an excepton while debugging on my local development machine

If it matters on my aspx page I have the following:

<%@ Register Assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"
Namespace="CrystalDecisions.Web" TagPrefix="CR" %>

And then in my web.config I have:

            <add assembly="CrystalDecisions.CrystalReports.Engine, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
            <add assembly="CrystalDecisions.ReportSource, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
            <add assembly="CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
            <add assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
            <add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>

along with a few other Crystal DLLs in my BIN directory.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T05:17:38+00:00Added an answer on June 2, 2026 at 5:17 am

    try:

    rptSP.DataSourceConnections[@"MyServer\MyInst", "MyDB"].SetConnection(@"MyServer\MyInst", "MyDB", "MyUsername", "MyPass");
    

    Notice the replacement of double backslashes with single ones, and the attendant @ symbol to go with them. I prefer this way to double backslashes because then I control the string formatting explicitly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using jquery datepicker, please see below code $(document).ready(function() { $(.txtDate).datepicker({ showOn: 'button',
I have a grid view control in my application. Please see the below code.
Please see the code below: #include <iostream> #include <stdlib.h> #include <time.h> using namespace std;
I've a problem with CakePHP __() function. Please see the code below : $options
I am using vb.net code. I have grid view, please see the code below:
Please see an example of my code below: CODE UPDATED public class ScrollableCheckboxList {
Please see below my code. I am attempting to bind an array of paramenters
Noob question here. Please see code below. Where can I read more on this?
Please see the code below. Basically, when the user creates an object of this
hey guys, i have very small issue please see the code below // this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.