日期:2014-05-16 浏览次数:20456 次
string strSql = "select * from 表" SqlDataReader reader = SqlHelper.GetDataReader(strSql); if (reader.Read()) { DateTime? n = reader["userTime"] == DBNull.Value ? (DateTime?)null : (DateTime)reader["userTime"]; int? m = Convert.IsDBNull(reader["userName"]) ? (int?)null : int.Parse(reader["userName"].ToString()); } else { reader.Close(); }[/size]