2020
10-10
10-10
C# DataSet查看返回结果集的实现
先看一段代码: privateDataSetGetDataSet(stringstrsql){stringstrcon="server=192.168.2.1,1433;uid=sa;pwd=123456;database=MyDB";SqlConnectioncon=newSqlConnection(strcon);DataSetds=newDataSet();try{SqlDataAdapterDA=newSqlDataAdapter(strsql,con);DA.Fill(ds,"tb");}catch(SqlExceptionE){thrownewException(E.Message);}con.Close();//关闭数...
继续阅读 >