如何把表中记录的参数名和参数值,赋值给类中的属性??数据库中的 参数表 如下:参数名 参数值
name "csdn"
email "[email protected]"----------------------类如下:public class Param
{
private string _name;
private string _email; public string Name
{
get { return this._name; }
set { this._name = value; }
} public string Email
{
get { return this._email; }
set { this._email = value; }
}}-----------------------如何把表中的记录一条一条读出来,并且设置到类中对应的每个属性上??要用到反射吗?有什么简单稳定的方法???
name "csdn"
email "[email protected]"----------------------类如下:public class Param
{
private string _name;
private string _email; public string Name
{
get { return this._name; }
set { this._name = value; }
} public string Email
{
get { return this._email; }
set { this._email = value; }
}}-----------------------如何把表中的记录一条一条读出来,并且设置到类中对应的每个属性上??要用到反射吗?有什么简单稳定的方法???
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货