问题描述
- win mobile6.1连接sql2008的问题,连结不上。如下代码:
-
??????????? string connStr;
??????????? connStr = "Password=;Persist Security Info=True;User ID=sa;Initial Catalog=erp;Data Source=192.168.0.199;";
??????????? SqlConnection io_conn = new SqlConnection(connStr);
??????????? try
??????????? {
??????????????? io_conn.Open();
??????????? }
??????????? catch
??????????? {
??????????????? MessageBox.Show("不能联结数据库服务器,V_V");
??????????????? return;
??????????? }
??????????? SqlCommand io_cmd = new SqlCommand();
??????????? io_cmd.Connection = io_conn;
??????????? io_cmd.CommandText = "select invCode from MyOrder order by poId";
??????????? SqlDataAdapter dbAdapter = new SqlDataAdapter(io_cmd);
??????????? DataSet ds = new DataSet();
??????????? dbAdapter.Fill(ds);
??????????? foreach (DataRow row in ds.Tables[0].Rows)
??????????? {
??????????????? miInfo.Text = row[0].ToString();
}
io_conn.Close();
解决方案
已经解决了,掌上电脑的无线问题。
解决方案二:
这段代码连接sql2000没有问题的。
时间: 2024-11-17 21:47:46