//转化成lsit集合形式//T 强类型类string sqlList="select * from table";
List<T>list= SqlConfig对象实例.GetInfoList(sqlList)<T>.ToList();
查询数量示例
//查询数量string sqlCount = string.Format("select count(*) as rows from {0} ", table)
int counts = SqlConfig对象实例.GetInfoCounts(sqlCount);
插入更新删除
//插入 //注意 user是强类型类 包含下面带@的字段属性,名称一样会进行自动填充//参数也可以是匿名类型new {Name=.,Password=.,.....}会自动填充string sql = "insert into userinfo(Name,Password,Phone,Address,Status) values(@Name,@Password,@Phone,@Address,@Status)";
bool result = SqlConfig对象实例.UpdateSql(sql,user);
//更新string sql = "update userinfo set name=@Name,password=@Password,phone=@Phone,address=@Address,status=@Status where id=@ID";
bool result = SqlConfig对象实例.UpdateSql(sql,user);
//删除string sql = string.Format("delete from userinfo where id in ({0})",ids);
bool result = SqlConfig对象实例.UpdateSql(sql);