标签:
1 protected SqlParameter[] CreadeSqlParameters(object obj) 2 { 3 List<SqlParameter> list = new List<SqlParameter>(); 4 foreach (PropertyInfo item in obj.GetType().GetProperties()) 5 { 6 string name = item.Name; 7 object value = item.GetValue(obj,null); 8 list.Add(new SqlParameter(name, value)); 9 } 10 return list.ToArray(); 11 }
标签:
原文地址:http://www.cnblogs.com/zhouzhuang/p/5132146.html