当前位置:Gxlcms >
数据库问题 >
ADO.NET基础必备之SqlCommand.Execute三方法
ADO.NET基础必备之SqlCommand.Execute三方法
时间:2021-07-01 10:21:17
帮助过:24人阅读
static void CreateCommand(
string queryString,
string connectionString)
{
using (SqlConnection connection = new SqlConnection(
connectionString))
{
connection.Open();
SqlCommand command = new SqlCommand(queryString, connection);
SqlDataReader reader = command.ExecuteReader();
while (reader.Read())
{
Console.WriteLine(String.Format("{0}", reader[
0]));
}
}
}
ADO.NET基础必备之SqlCommand.Execute三方法
标签:strong sys override 引用 esc over cti insert 对象