SQL Connection/ASP.NET/Code Behind - Access Denied

Discussion in 'Databases' started by seanroberts, Jan 27, 2005.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Hello all,

    I have been experiencing some problems connecting to my SQL server. I am using the code below:




    strSQL = "SELECT Content From PageTypes Where PageTypeID='" & tmpPageTypeID & "';"


    Conn = New SqlConnection("Data Source=mssql04.discountasp.net;Initial Catalog=db_56242;User ID=********;Password=********")


    myda = New SqlDataAdapter(strSQL, Conn)


    dsPageTypeContent = New DataSet()


    myda.Fill(dsPageTypeContent, "PageTypeContent")


    Conn.Close





    Please keep in mind that this is a code behind file, content.aspx.vb . Just in case someone asks, the following namespaces are imported:


    Imports System.Data


    Imports System.Data.SqlClient





    I have been trying to solve this problem for almost a year now off and on. A solution sent to me, an example, used in-line coding... This works fine. I use the exact same code in the codebehind and all of a sudden the SQL server can not be found...


    HELLLLPPP!!





    Thanks,


    Sean
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    Make sure you upload the latest version of the DLL.

    If you are using VS.net, there's some weird problem that i've seen that it will not over write the dll. I suggest you check the timestamp on the file.

    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page