Connection Error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sonu5588
    New Member
    • Aug 2007
    • 13

    Connection Error

    I am facing problem in connection. This code is OK , when i Deploy or Create a EXE of this project and install it on other system then the connection error generates, whats the solution to create a globel connection, any body tell me ,,,,,,,......

    [code=vbnet]
    Public Class Utils
    '//*************** * Connection MUNNA-AB15B2413\SQLEX PRESS
    Public Shared Connection As String = "Server='MU NNA-AB15B2413\SQLEX PRESS';uid=sa;p wd=123;Initial Catalog=ICS"

    End Class


    Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles cmdlogin.Click
    Dim con As New SqlConnection(U tils.Connection )
    con.Open()
    Dim Query As String = "Select * from Login WHERE username = '" + txtusrname.Text + "' and password = '" + txtpwd.Text + "'"
    Dim cmd As New SqlCommand(Quer y, con)
    Dim reader As SqlDataReader = cmd.ExecuteRead er
    If reader.Read Then
    Main.Show()
    Me.Hide()
    Else
    MsgBox("Invalid Username / Password")
    End If

    End Sub[/code]
  • kenobewan
    Recognized Expert Specialist
    • Dec 2006
    • 4871

    #2
    Seems like you are going to need an IP or domain to use in your connection string.

    Comment

    • aamirvip
      New Member
      • Feb 2008
      • 7

      #3
      you are right ken...
      Last edited by Shashi Sadasivan; Feb 4 '08, 01:13 AM. Reason: removing links to external sites provided in signature

      Comment

      Working...