|
-
Jun 5th, 2007, 04:58 PM
#1
Thread Starter
New Member
PPC connection with MSSQL Express Edition
I've the following VB code to connect to MSSQL 2005 express edition:
Imports System.data.sqlclient
Imports System.Data.SqlServerCe
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim CONStr As String = "Server=192.168.1.5;database=pos;user id=sa;password=123"
Dim ccon As New SqlConnection(CONStr)
Try
ccon.Open()
MsgBox(ccon.State)
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
End Class
tried to write the port 1433 after I configured the sql setting to accept TCP/IP port 1433 and delete 0 from dynamic.
I wrote many connection string like:
"data source=192.168.1.5,1433\Sqlexpress;initial catalog=pos;user id= sa;password=123"
or
"data source=192.168.1.5\Sqlexpress;initial catalog=pos;user id= sa;password=123"
or
"data source=Mycom_name\Sqlexpress;initial catalog=pos;user id= sa;password=123"
the error message was (sql exception error) and another one was (a native exception has occurred in xyz.exe
what is the problem?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|