Click here to Skip to main content
15,885,915 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello sir got a problem here. As you see last week everything works fine and im on the debugging mode. But my partner accidentally(>_<) change my work and now it has an error i havent encountered at all. Please help me
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
pointing at FoundUser = SearchUser.GetDataUser
my codes are as follows
VB
Partial Class HomeLogIn
    Inherits System.Web.UI.Page

    Protected Sub btnLogIn_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnLogIn.Click
        Dim SearchUser As New DataSet1TableAdapters.tblUserTableAdapter
        Dim FoundUser As New DataSet1.tblUserDataTable

        FoundUser = SearchUser.GetDataUser
        Dim Found As Boolean = False
        Session("UserID") = ""
        For Each Srow As DataSet1.tblUserRow In FoundUser
            If txtUserID.Text = Srow.UserID And txtPassword.Text = Srow.PassID Then
                Found = True
                Session("UserID") = txtUserID.Text

                Response.Redirect("Home.aspx")
            End If
        Next

        If Not Found Then
            '            Image1.Visible = True
            lblUserID.Visible = True
            lblUserID.Text = "Incorrect UserID or Password"
            Session("UserID") = txtUserID.Text
        End If
        If Found Then
            'lblUserID.Text = "Matagumpay ka!"
        End If
    End Sub

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        lblDate1.Text = DateTime.Today.ToString("dd-MMM-yyyy")
        txtUserID.Focus()
    End Sub
End Class
Posted
Comments
Chris Maunder 16-Aug-11 22:31pm    
Show us the code for GetDataUser. That's where the error is. Have you checked your connection strings?
Dr.Walt Fair, PE 16-Aug-11 22:33pm    
It sounds like you need to have a forceful heart-to-heart discussion with your partner ...

1 solution

janwel wrote:
But my partner accidentally(>_<) change my work and now it has an error…
So, before sorting out the problem with you SQL connection sort our the problem of owning your code. You're not really own it, because you can mess it up any minute. My advice is: stop doing what you're doing and start working under Revision Control System. It's easy, inexpensive it terms of required resource and free of charge (if you make a right decision and use Open Source system; don't risk your valuable code asserts by trusting a proprietary code: they support it today but tomorrow may disappear from the market).

See this discussion: Revision control systems, which to choose from?[^] in general and my solution in particular.

Good luck,
—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900