Please can anybody help me out with this connection string i am using sql server 2000 and visual basic.net 2008 i have problem in the connection string
Server Ip Address is 192.168.2.100/Database Name = Ad_Soft/Password=adsoft
Public Function ConString() As String
Return "Provider=SqlOLEDB;Source =192.168.2.100;Initial Catalog=Ad_Soft; uid=sa;Password = adsoft"
End Function
when i try to call this function it keeps on giving me the Error "INVALID OBJECT NAME PASSWORD"
Private
Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click
Try
Dim dbConn As OleDb.OleDbConnection
Dim dbCommand As New OleDb.OleDbCommand
dbConn =
New OleDb.OleDbConnection(ConString())
dbConn.Open()
dbCommand.CommandText = "SELECT * FROM [Password] Where UserName = '" & UsernameTextBox.Text & "' And [Password] = '" & PasswordTextBox.Text & "'"
dbCommand.Connection = dbConn
Dim dbDR As OleDb.OleDbDataReader = dbCommand.ExecuteReader
If Not dbDR.HasRows Then
MsgBox("Access Denied", MsgBoxStyle.OkOnly)
Else
End If
dbConn.Close()
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical, "Error")
End Try
End Sub
- Add new comment
- 2 views