Problem with Visual Studio and SQL connection string on SP3

Discussion in 'Windows Desktop Applications (x86/x64)' started by ecustom, Nov 18, 2015.

  1. ecustom

    ecustom New Member

    Joined:
    Nov 18, 2015
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    My Device:
    SPro3
    I'm having a problem running a VS project using a SQL connection string on the SP3 . I do not have this problem on the desktop using the same connection string. I was curious if anyone else had this problem and how it was corrected.

    Using VS2012 and using this connection string on the desktop:
    "Server=myServer\myInstance;Database=myDatabase;Trusted_Connection=True;"
    No problems on desktop but when run on the SP3, I get a SQL exception (instance-specific error).

    If I change the connection string on the SP3 to "Server=myOtherServerWithoutInstanceName;Database=myDatabase;Trusted_Connection=True;" then the connection is accepted and the VS project runs just fine.

    Is it a setting on the tablet that needs to accept instance names in sql server?
     
  2. leeshor

    leeshor Well-Known Member

    Joined:
    Jun 19, 2012
    Messages:
    5,071
    Likes Received:
    877
    Trophy Points:
    113
    Location:
    Norcross, GA
    My Device:
    SPro4
    Welcome to the forum

    Since this is more of an app issue than Surface specific this is getting moved to the x86 app section of the forum.
     
  3. ecustom

    ecustom New Member

    Joined:
    Nov 18, 2015
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    My Device:
    SPro3
    I'm not sure if it is an app issue. Why would this problem occur on the SP3 but not the desktop?

    Update: If I publish the app using Visual Studio on my desktop, and set the connection string to myServer\myInstance, then I can run the published app on the tablet. But if I open Visual Studio on the tablet, then try to run the app thru VS and connected to myServer/myInstance, then the sql exception occurs.

    Using VS on the tablet, if I change the connection to myOtherServerWithoutInstanceName, then the app will run thru VS successfully.

    Other apps connected to myServer\myInstance on the tablet run successfully. OK, I agree this is a clue that it might be an issue with the app and not the tablet.

    I was just curious if anyone else had a similar issue and how they corrected it.
     

Share This Page