Unable to connect to remote production database from ASP.NET

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sathyaprakashg
    New Member
    • Mar 2008
    • 1

    Unable to connect to remote production database from ASP.NET

    Hi All,

    I am trying to connect to an SQL SERVER in a remote production server from ASP.net using following code.

    Dim conProd As New OleDbConnection ("Provider=SQLO LEDB.1;Data Source=ServerNa me;UID=User Name;PWD=Passwo rd;Initial Catalog=Databas e")
    conProd.Open()

    I am getting following error while running this script

    [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.

    But I am able to connect to this server using following three other ways:

    1) Using query analyzer

    2) I created DSN and performed test connection, it succeded.

    3) In ASP.NET -> Server Explorer -> Data Connections, I added this connection and test connection also successful.

    I tried to connect to this server in VB 6.0 using following code

    Dim conProd As New ADODB.Connectio n

    conProd.Open "Provider=SQLOL EDB;Data Source=ServerNa me;Initial Catalog=Databas e; Timeout=500;", "UserName", "Password"

    I am able to connect using this above code in VB 6.0 also.

    But I dont what is happeing in .NET. Please help me.

    I am using XP and VS .NET 2003
  • kunal pawar
    Contributor
    • Oct 2007
    • 297

    #2
    I guess, in dot net it does not required to mention Provider. So remove provider and try again

    Comment

    Working...