将Pocket PC连接到SQL Server 2000 [英] connect pocket pc to sql server 2000

查看:99
本文介绍了将Pocket PC连接到SQL Server 2000的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


这是我的连接字符串:

hi ,
this is my connection string :

string strConnection = "Data Source=PROGRAMCO-PC,1433;Initial Catalog=test;User ID=sa;Password=;";
string strCommand = "Select * from tblMosh";
SqlConnection connDB = new SqlConnection(strConnection);
connDB.Open();



启用sql server配置管理器中的tcp/ip!

错误:

在System.Data.SqlClient.SqlConnection.OnError(SqlException异常,TdsParserState状态)处
在System.Data.SqlClient.SqlInternalConnection.OnError(SqlException异常,TdsParserState状态)下
在System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
在System.Data.SqlClient.TdsParser.Connect中(字符串主机,SqlInternalConnection connHandler,Int32超时)
在System.Data.SqlClient.SqlInternalConnection.OpenAndLogin()
在System.Data.SqlClient.SqlInternalConnection..ctor(SqlConnection连接,Hashtable connectionOptions)
在System.Data.SqlClient.SqlConnection.Open()
在SmartDeviceProject1.Form1.fillGrid()
在SmartDeviceProject1.Form1.Form1_Load(Object sender,EventArgs e)
在System.Windows.Forms.Form.OnLoad(EventArgs e)中
在System.Windows.Forms.Form._SetVisibleNotify(Boolean fVis)
在System.Windows.Forms.Control.set_Visible(布尔值)
在System.Windows.Forms.Application.Run(Form fm)中
在SmartDeviceProject1.Program.Main()



tcp/ip in sql server configuration manager is enable!

error :

at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, TdsParserState state)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, TdsParserState state)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
at System.Data.SqlClient.TdsParser.Connect(String host, SqlInternalConnection connHandler, Int32 timeout)
at System.Data.SqlClient.SqlInternalConnection.OpenAndLogin()
at System.Data.SqlClient.SqlInternalConnection..ctor(SqlConnection connection, Hashtable connectionOptions)
at System.Data.SqlClient.SqlConnection.Open()
at SmartDeviceProject1.Form1.fillGrid()
at SmartDeviceProject1.Form1.Form1_Load(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form._SetVisibleNotify(Boolean fVis)
at System.Windows.Forms.Control.set_Visible(Boolean value)
at System.Windows.Forms.Application.Run(Form fm)
at SmartDeviceProject1.Program.Main()

推荐答案

上,如果要远程连接,则必须首先进行混合身份验证,并且您的服务器是否在本地连接?如果您应用了IP,端口,然后可以ping通该IP,然后查看结果,则更为准确.并尝试使用EMS应用相同的数据进行连接.
在很多情况下会导致此类错误,因此您必须对防火墙进行仔细检查,IP ping,所有服务均已启用.有时会为这个愚蠢的问题感到抱歉,例如在设备上工作时检查无线或GPRS.

问候.
if you are connecting remotely you have first to make the authentication to mixed authentication , and is your server you are connecting locally ? it is more accurate if you apply the IP,port and then you can ping to that IP and see the result.. and also try connecting by applying the same data using the EMS .
there are many cases to cuase such error so you have to make double check on your firewall , IP ping, all services are enabled. and sometimes sorry for that silly issue such as check the wireless or GPRS if working on the device.

regards..


这篇关于将Pocket PC连接到SQL Server 2000的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆