mobile 连接sql sever问题
string sql = "select count(ID) from Uerinfo where uername="+textBox1.Text;
string tablename = textBox1.Text;
string remoteDB = "UerMsg";
string user = "sa";
string pwd = "";
string remoteIP = "192.168.1.1";
string rdaOleDbConnectString = "Data Source=" + remoteIP + ";Initial Catalog=" + remoteDB + ";User Id=" + user + ";Password =" + pwd;
try
{
SqlConnection sqlcon = new SqlConnection(rdaOleDbConnectString);
sqlcon.Open();
SqlCommand com = new SqlCommand(sql, sqlcon);
if ((int)com.ExecuteScalar() > 0)
{
MessageBox.Show("用户存在");
}
sqlcon.Close();
}
catch (PlatformNotSupportedException pe)
{
MessageBox.Show(pe.ToString());
}
大家帮我看看 这个代码有问题吗?我是在ppc模拟器上直接连接数据库的····这样行不行