Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Jul 2003
    Location
    Jacksonville, FL
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    .Net - SQL Server does not exist or access denied

    Greetings,

    When I try to use the .Net data provider namespace System.Data.SqlClient on my ASP.Net pages. I get the error
    SQL Server does not exist or access denied.
    If I change my code to use System.Data.ODBC and use the corresponding Object model for ODBC, my pages work great. I have an SQL2000 server with SP3 running on my corporate WAN and a seperate Web server with the 1.1 framework. All ASP pages work fine using ADO and ODBC or SQLOLEDB, but ASP.Net only works with ODBC. I would like to eliminate the ODBC layer. I have tried using integrated security and SQL authenication. Any ideas?

    This would be a typical snippet for a datagrid's databinding.

    Code:
    sub BindData()
            Dim connectionString As String = "server='UWQJAXCNV01'; trusted_connection=true; database='ucd'"
            Dim dbConnection As System.Data.IDbConnection = New System.Data.SqlClient.SqlConnection(connectionString)
            Dim queryString As String = "SELECT * FROM jerry.customer"
            Dim dbCommand As System.Data.IDbCommand = New System.Data.SqlClient.SqlCommand
            dbCommand.CommandText = queryString
            dbCommand.Connection = dbConnection
            Dim dataAdapter As System.Data.IDbDataAdapter = New System.Data.SqlClient.SqlDataAdapter
            dataAdapter.SelectCommand = dbCommand
            Dim dataSet As System.Data.DataSet = New System.Data.DataSet("Cust_List")
            dataAdapter.Fill(dataSet)
            DataGrid1.datasource = _
            dataSet.Tables("Cust_List").Defaultview
            DataGrid1.databind
        end sub

    Thanks,

    Jerry

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Cincinnati, OH
    Posts
    545
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Since you are using a trusted connection be sure the ASPNET account has rights to that database.
    does this sig match?

  • #3
    New Coder
    Join Date
    Jul 2003
    Location
    Jacksonville, FL
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    From what I have read, the ASPNET account can be used if the Web server and the SQL server are on the same box. ASPNET is a local user only.

  • #4
    New to the CF scene
    Join Date
    Jul 2004
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    use user=user;pwd=password in sql connection string instead of trusted_connection=yes


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •