我很抱歉用我的低级别问题来困扰你。手机应用程序无法看到远程sql server?
我想开发一个非常非常非常简单的应用程序,它会连接MS SQL SERVER在我的笔记本,将在手持终端,采用Windows Mobile 6
这里运行是我使用的代码:
Dim strSQL As [String] = "SELECT COUNT(studentid) AS totalp from Students where gender='m' "
' Dim Conn As New SqlConnection("Data Source=10.0.0.4\MUSTAFASQL2;Initial Catalog=MYDBX;User ID=TEACHERA") <<< i used this too,
' Dim Conn As New SqlConnection("Data Source=10.0.0.4:1433\MUSTAFASQL2;Initial Catalog=MYDBX;User ID=TEACHERA;") <<< and also tried this
Dim conn As New SqlConnection("Data Source=MUSTAFA\MUSTAFASQL2;Initial Catalog=MYDBX;User ID=TEACHERA;")
Conn.Open() *<<<<<<<<< crashes here with this error : "Specified SQL server not found : MUSTAFA\MUSTAFASQL2"*
Dim cmd As New SqlCommand(strSQL, Conn)
Dim musreader As SqlDataReader = cmd.ExecuteReader
While musreader.Read
total.Text = musreader.Item("totalp").ToString
End While
Conn.Close()
on button click。
一些细节: 设备:Windows Mobile 6.1操作系统的经典
地方:SQLEXPRESS,我可以从多台计算机达到,我的意思是有远程访问到我的SQL Server没有问题。
请帮助我,所有帮助表示赞赏。非常感谢。 如果您需要了解更多详细信息,请告诉我...
你可以ping网络上的WinMo设备吗?你能从WinMo设备的浏览器访问服务器吗?这听起来像无法路由(即它不在网络上)或它是一个证书问题。 – ctacke 2010-06-21 01:39:43
从移动设备,我可以ping通10.0.0.4成功,但一旦我添加任何端口号在IP号码末尾(即:10.0.0.4,1433或10.0.0.4:1433) 我可以ping移动设备从它的本地IP(10.0.0.6) 所有防火墙或类似安全程序都被禁用以进行测试。 – 2010-06-21 05:47:48
这里是我在System.Data.SqlClient.SqlConnection.OnError()的System.Data.SqlClient.SqlInternalConnection.OnError() 处的System.Data.SqlClient.SqlConnection.OnError()上的conn.open() 上收到的错误代码。System.Data.SqlClient.TdsParser。 ThrowExceptionAndWarning() at System.Data.SqlClient.TdsParser.Connect() at System.Data.SqlClient.SqlInternalConnection.OpenAndLogin() at System.Data.SqlClient.SqlInternalConnection..ctor() at System.Data.SqlClient .SqlConnection.Open() 在MobilgSTS1.Form1.Form1_Load() 在System.Windows.Forms.Form.OnLoad() 在System.Windows.Forms.Form._SetVisibleNotify() 在System.Windows.Forms.Control的.set_Visible() .... – 2010-06-21 06:11:57