摘要:
DataReader 常用属性FieldCount 获取字段数目IsClosed 取得状态True or FalsItem({name,ordinal}) 获取或设置字段内容,name为字段名,ordinal为字段序号,可选用RecordsAffected 获取执行insert delete 或update后有多少行受到影响DataReader 常用方法CLose() 关闭GetBoolean(ordinal) 取得第 ordinal+1列的内容,返回值为boolean类型,还有GetByte(ordinal),GetDecimal(ordinal).....GetDataTypeName(o 阅读全文
posted @ 2011-04-11 10:22
勇气
阅读(2448)
评论(0)
推荐(0)
摘要:
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(& 阅读全文
posted @ 2011-04-11 10:16
勇气
阅读(1084)
评论(0)
推荐(0)

浙公网安备 33010602011771号