+ Reply to Thread
Results 1 to 7 of 7

Thread: Cannot find server error

  1. #1
    Administrator richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere only we know...
    Posts
    1,724
    Blog Entries
    10
    Rep Power
    11

    Cannot find server error

    I have just uploaded a new page to my app, but when I try and navigate to it, I get a "Cannot find server" error.

    All the other pages in the app seem to be working fine.

    I presume that there is a problem in my code, but it's not throwing an exception.

    Any ideas what might be causing this error to occur?

  2. #2
    Administrator richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere only we know...
    Posts
    1,724
    Blog Entries
    10
    Rep Power
    11

    OK. I think I have located the source of the problem.

    Have a problem with a couple of functions in my DAL. Just need to isolate what the problem is now.

  3. #3
    Administrator richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere only we know...
    Posts
    1,724
    Blog Entries
    10
    Rep Power
    11

    OK, I just cannot see what the problem is with this code. If I run it, it causes a "Cannot find server" error. It's absolutely doing my head in.

    .aspx.vb
    [highlight=asp]
    Sub build_marital_status()
    ddl_marital1.DataSource = SiteBLL.GetMaritalStatusList()
    ddl_marital1.DataValueField = "ref"
    ddl_marital1.DataTextField = "type"
    ddl_marital1.DataBind()
    End Sub
    [/highlight]

    BOL
    [highlight=asp]
    Public Class MaritalList
    Inherits List(Of MaritalType)
    Public Sub New()
    End Sub

    Private _page_error As String = String.Empty
    Public Property page_error() As String
    Get
    Return _page_error
    End Get
    Set(ByVal value As String)
    _page_error = value
    End Set
    End Property
    End Class

    Public Class MaritalType
    Public Sub New(ByVal p_ref As String, ByVal p_type As String)
    ref = p_ref
    type = p_type
    End Sub

    Private _ref As String = String.Empty
    Public Property ref() As String
    Get
    Return _ref
    End Get
    Set(ByVal value As String)
    _ref = value
    End Set
    End Property

    Private _type As String = String.Empty
    Public Property type() As String
    Get
    Return _type
    End Get
    Set(ByVal value As String)
    _type = value
    End Set
    End Property
    End Class
    [/highlight]

    BLL Code
    [highlight=asp]
    Public Shared Function GetMaritalStatusList() As MaritalList

    Return GetMaritalStatusList()

    End Function
    [/highlight]

    DAL Code
    [highlight=asp]
    Public Shared Function GetMaritalStatusList() As MaritalList
    Dim MaritalList As New MaritalList
    Dim conn As New MySqlConnection(ConnDAL.connString)
    Dim mycommand As New MySqlCommand("SELECT statusref,marital_status FROM marital_status", conn)
    Dim rsgr As MySqlDataReader
    Using conn
    Using mycommand
    Try
    conn.Open()
    rsgr = mycommand.ExecuteReader
    If rsgr.HasRows Then
    Do While rsgr.Read
    MaritalList.Add(New MaritalType(rsgr("statusref"), rsgr("marital_status")))
    Loop
    End If
    rsgr.Close()
    Catch ex As Exception
    MaritalList.page_error = ex.ToString
    Finally
    mycommand.Dispose()
    conn.Close()
    conn.Dispose()
    End Try
    End Using
    End Using

    Return MaritalList

    End Function
    [/highlight]

    I have run the query directly in the db and it works fine. I use exactly the same code on another ddl that I populate from the db and that works fine.

    I just cannot see why this causes this error.

    Any ideas?
    Last edited by richyrich; November 25th, 2008 at 12:57 PM.

  4. #4
    The Barnfather jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead has much to be proud of jmurrayhead's Avatar
    Join Date
    Mar 2008
    Location
    Washington, D.C.
    Posts
    2,347
    Blog Entries
    9
    Rep Power
    19

    Your posted code is hard to read..so it's hard to tell...however, I'm sure the real error is being hidden. If using IE, do you have script debugging enabled in the Internet Options? If not, you won't see the real error message. It could be a server 500 error. Make sure everything is all right with your database connection and such.
    jmurrayhead
    If you agree, give me rep. If my post helped you, click "Thanks".
    If you like it here...throw us a few bones to help support us.


  5. #5
    Administrator richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere only we know...
    Posts
    1,724
    Blog Entries
    10
    Rep Power
    11

    Quote Originally Posted by jmurrayhead View Post
    Your posted code is hard to read..so it's hard to tell...however, I'm sure the real error is being hidden. If using IE, do you have script debugging enabled in the Internet Options? If not, you won't see the real error message. It could be a server 500 error. Make sure everything is all right with your database connection and such.
    Sorry, when I cut and post it loses all the formatting...Have reformatted it now...

    I'm not sure about the script debugging...What I'd normally do when I get problems is debug by catching the errors and then writing them to the screen.

    However, I've not come across this issue before where it gives a Cannot find server error, so I can't even get to try and catch any error.

  6. #6
    Administrator richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere only we know...
    Posts
    1,724
    Blog Entries
    10
    Rep Power
    11

    OK. I unticked Disable Script Debugging (Internet Explorer) and (Other) and just get a blank screen when I try and load the page.

    If there is an error, I don't understand why it isn't throwing an exception...

  7. #7
    Administrator richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich is a splendid one to behold richyrich's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere only we know...
    Posts
    1,724
    Blog Entries
    10
    Rep Power
    11

    OK. Found the problem
    This
    [highlight=asp]
    Public Shared Function GetMaritalStatusList() As MaritalList
    Return GetMaritalStatusList()
    End Function
    [/highlight]
    Should have been
    [highlight=asp]
    Public Shared Function GetMaritalStatusList() As MaritalList
    Return SiteDAL.GetMaritalStatusList()
    End Function
    [/highlight]
    I knew it must have been something easy.

    Thank the lord for that....
    Last edited by richyrich; November 25th, 2008 at 01:33 PM.

+ Reply to Thread

Similar Threads

  1. Disabling a field after the Find command
    By kl99ny in forum Microsoft Access
    Replies: 11
    Last Post: October 7th, 2008, 06:35 PM
  2. Server Side Includes .stm file error
    By peebman2000 in forum HTML & CSS Help
    Replies: 6
    Last Post: August 4th, 2008, 10:29 AM
  3. Error Type:Active Server Pages, ASP 0113 (0x80004005)
    By guddu in forum ASP Development
    Replies: 20
    Last Post: July 11th, 2008, 09:44 AM
  4. find words and change
    By todd2006 in forum JavaScript Programming
    Replies: 4
    Last Post: July 2nd, 2008, 09:58 AM

Bookmarks

Posting Permissions

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

SEO by vBSEO