请问ExecuteReader()是什么意思?

ExecuteReader()----执行命名,返回一个类型化的 IDataReader
简化代码如下:

using (SqlConnection conn = new SqlConnection(connString))
            {
                string sqlString = "proc_InsertNewContact";
                SqlCommand sqlCmd = new SqlCommand(sqlString,conn);
                sqlCmd.CommandType = CommandType.StoredProcedure;

                sqlCmd.Parameters.AddWithValue("@AddressLine1", mAddressLine1);
                conn.Open();
                SqlDataAdapter sqlreader = sqlCmd.ExecuteReader();
               
                conn.Close();
            }

你可能感兴趣的:(execute)