sample code sql server authentication mode. how to connect to server using vb .net .
Public mUserId As String
Public sUserId As String = "sa"
Public sPassWord As String = "sa123"
Public sDatabase As String = "CampusIndya"
Public sServer As String = "MURUGAN\SQLEXPRESS"
Public Sub GetConnection()
If MyConnection.State = ConnectionState.Closed Then
MyConnection.ConnectionString = "User ID=" & sUserId & ";Password=" & sPassWord & ";database=" & sDatabase & " ;server=" & sServer
End If
End Sub
|