I want to connect a MSDE database exists in the desktop from Pocket pc 2003 application developed using vb.net. It is giving sql server not found error. It is working in the pocket pc simulater. But it is not working in the pocket pc device. Connection is also working sql server 2000 database. Please help me.Want to show us the connection string?
Might help...|||cs = "data source=mypc\test;initial catalog=test;user id=sa;persist security info=False;workstation id=mypc\test;packet size=4096"|||It's not listed here (and you should post the actual one) but are you supplying a password?|||Originally posted by Brett Kaiser
It's not listed here (and you should post the actual one) but are you supplying a password?
Not supplying the password
I am not supplying the password. I have used the following entries in the setup.ini file while installing the MSDE
[Options]
INSTANCENAME=TEST
SECURITYMODE=SQL
BLANKSAPWD=1
I think i no need a password here. I have also tried with password it is giving same problem. here the code...
Dim cnfordesktop As New System.Data.SqlClient.SqlConnection
'-----------------------
' Open the desktop connection
'-----------------------
Public Function OpenConnectionForDeskTop() As Boolean
Dim cnstr As String = ConnectionStringForDeskTop()
Try
cnfordesktop = New system.Data.SqlClient.SqlConnection(cnstr)
cnfordesktop.Open()
Catch e As SqlClient.SqlException
MessageBox.Show("Error Number: " & e.Number & ", Error Message: " & e.Message & ", Command: " & cnstr, "Database ", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1)
Return False
End Try
Return True
End Function
'-----------------------
'close the connection
'-----------------------
Public Sub CloseConnectionForDesktopVM()
Try
cnfordesktop.Close()
Catch ex As Exception
End Try
End Sub
'-----------------------
'Set the connection string property
'-----------------------
Public Function ConnectionStringForDeskTop() As String
Dim cs As String = ""
cs = "data source=mypc\test;initial catalog=test;user id=sa;password=;persist security info=False;"
Return cs
End Function
No comments:
Post a Comment