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();
已經解決了,掌上電腦的無線問題。