62,046
社区成员
发帖
与我相关
我的任务
分享
public DataSet GetDS(string sql)
{
DataSet ds= new DataSet();
using(GetConn())
{
using (SqlDataAdapter sda=new SqlDataAdapter(sql,Conn))
{
try
{
sda.Fill(ds);
return ds;
}
catch{
.......
}
}
}
}
public DataSet GetDS(string sql) {
DataSet ds= new DataSet();
using(System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection("")) {
using (System.Data.SqlClient.SqlDataAdapter sda= new System.Data.SqlClient.SqlDataAdapter()) {
System.Data.SqlClient.SqlCommand cmd = conn.CreateCommand();
cmd.CommandTimeout = 3600;
cmd.CommandText = sql;
cmd.CommandType = CommandType.Text;
sda.SelectCommand = cmd;
try {
sda.Fill(ds);
return ds;
}
catch(Exception ex){
throw ex;
}
}
}
}