ADO.NET connnection for client failover

  • Hi Guys,

    I am trying to connect my client application by using the following:

    ....is this right?

    Because I cannot get connection after I test, and shutdown my primary database, the mirror becomes the principal, but the application fails. " ....cannot connect to database... ", but supposed to read the partner right?

    Please any idea?, Am I missing something?

    Please help.

    Thank you.

  • Sorry Guys, my script didn't show up...here it is:

    add name="Site_DevConnectionString" connectionString="Data Source=dbA; failover partner=dbB; Initial Catalog=KPM; Integrated Security=True; User ID=WebUser" providerName="System.Data.SqlClient"

    Thanks for any help.

  • Can you post the full error?

    Jack Corbett
    Consultant - Straight Path Solutions
    Check out these links on how to get faster and more accurate answers:
    Forum Etiquette: How to post data/code on a forum to get the best help
    Need an Answer? Actually, No ... You Need a Question

  • This is the exact error I got....and I don't know why, the mirror becomes pricipal, but the weird thing is that next to principal, appears, disconnected like this: DatabaseName(Principal, disconnected) ....why is happening? ...

    "An unhandled error was generated and has been logged. We are sorry for the inconvenience and ask that you retry your request."

    Please any help???

  • Guys,

    I feel terrible, no body can help me???, well I know I am not that guru, neither for giving details trying to explain the error message, but at least a little guide will be good...

    Well, just a guide....is better if I need to use my connection string with ServerA=tcp:servername\instA: failure PartnerB=tcp:servername\instB????....or is there any pros just using it without "tcp" word???

    Any advice??

    Thanks

  • Based on what I have learned you don't appear to be doing anything wrong in your connection string.

    Have you tried putting the connection code in a Try Catch block and seeing if you can get a better error message?

    Are all the accounts setup correctly on the mirror server as well as the principal?

    In your original post in the connection string you are using Trusted Connection, but you provide a User Id as well, this is not necessary. I would recommend using the Application Name attribute though.

    Jack Corbett
    Consultant - Straight Path Solutions
    Check out these links on how to get faster and more accurate answers:
    Forum Etiquette: How to post data/code on a forum to get the best help
    Need an Answer? Actually, No ... You Need a Question

  • Thank you Jack,

    You were right, I was missing one account, althought I copy it, for some reason appeared as disable, so the application was not able to read it.

    Thank you for your help...

  • Glad I could be of help. Sometimes it just takes another perspective.

    Jack Corbett
    Consultant - Straight Path Solutions
    Check out these links on how to get faster and more accurate answers:
    Forum Etiquette: How to post data/code on a forum to get the best help
    Need an Answer? Actually, No ... You Need a Question

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply