SqlDataAdapter需要打开和关闭连接吗?如果不做会有什么不良后果吗?
string conn="数据库连接字符串";
string str = "select zcj from table where xm='张三'";
SqlDataAdapter da = new SqlDataAdapter(str, conn);
DataSet ds = new DataSet();
da.Fill(ds);
textbox.text=ds.tables[0].rows[0][0].Tostring();