By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,649 Members | 2,142 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,649 IT Pros & Developers. It's quick & easy.

Connection Error

sonu5588
P: 13
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 ,,,,,,,......

Expand|Select|Wrap|Line Numbers
  1. Public Class Utils
  2.     '//**************** Connection MUNNA-AB15B2413\SQLEXPRESS
  3.     Public Shared Connection As String = "Server='MUNNA-AB15B2413\SQLEXPRESS';uid=sa;pwd=123;Initial Catalog=ICS"
  4.  
  5. End Class
  6.  
  7.  
  8. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdlogin.Click
  9.         Dim con As New SqlConnection(Utils.Connection)
  10.         con.Open()
  11.         Dim Query As String = "Select * from Login WHERE username = '" + txtusrname.Text + "' and password = '" + txtpwd.Text + "'"
  12.         Dim cmd As New SqlCommand(Query, con)
  13.         Dim reader As SqlDataReader = cmd.ExecuteReader
  14.         If reader.Read Then
  15.             Main.Show()
  16.             Me.Hide()
  17.         Else
  18.             MsgBox("Invalid Username / Password")
  19.         End If
  20.  
  21.     End Sub
Feb 2 '08 #1
Share this Question
Share on Google+
2 Replies


kenobewan
Expert 2.5K+
P: 4,871
Seems like you are going to need an IP or domain to use in your connection string.
Feb 2 '08 #2

P: 7
you are right ken...
Feb 3 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.