62,269
社区成员
发帖
与我相关
我的任务
分享
public SqlDataReader GetList(string Sql)
{
string ConnectionString = "data source=localhost;initial catalog=DatabaseName;integrated security=SSPI;user ID=sa;password=123456";
SqlConnection myConnection = new SqlConnection(ConnectionString);
SqlCommand myCommand = new SqlCommand(Sql, myConnection);
myConnection.Open();
SqlDataReader result = myCommand.ExecuteReader(CommandBehavior.CloseConnection);
return result;
}