我一直觉得做一些行业应用系统只需要会两样东西:语言+数据库
足够足够了,不涉及任何算法,不涉及高深的computer science的东西
//string strConnection = "user id=test1;password=123123;";
//strConnection += "initial catalog=test;Server=MICROSO-PVQQJ99;";
//string strConnection = "server=MICROSO-PVQQJ99/SQLEXPRESS; uid=test1; pwd=123123; database=test;";
string strCon1 = @"Server = 192.168.40.26/XFORM2;database = xform2;User ID = sa;Password = 123123";
string strCon2 = @"Data Source=MICROSO-PVQQJ99/SQLEXPRESS;Initial Catalog=test;Integrated Security=SSPI";
string strCon3 = @"Data Source=MICROSO-PVQQJ99/SQLEXPRESS;database = test;User ID = test1;Password = 123123";
try
{
objConnection = new SqlConnection(strCon3);
objConnection.Open();
}
catch (Exception ex)
{
Response.Write(ex.ToString());
}
DataSet ds = new DataSet();
string SelectCommand = "SELECT * FROM dbo.stu_table";
SqlDataAdapter da = new SqlDataAdapter(SelectCommand, objConnection);
da.Fill(ds);
SqlDataReader rdr = null;
SqlCommand cmd = new SqlCommand("select * from dbo.stu_table", objConnection);
rdr = cmd.ExecuteReader();
while (rdr.Read())
{
Response.Write(rdr[0] + "/t" + rdr[1]+ rdr[2] + "/t" + rdr[3] + "/t"
+ rdr["stu_height"] + "/t" + rdr["stu_weight"] +
"<br />");
}