ADO.NET面向对象 属性扩展

例:
public class Users{

private bool _sex;
public bool sex
{
get{_return _sex;}
set{_sex=value}
}
public string sexx
{
get{return _sex?"男":"女";}
}

}

2
public  class nation{
private string  _Nationcode;
public string nationcode{}
public string _nationname;
public string nationname{};



方法:
public string selectname(string ncode){
string result="无";


select * from nation where nationcode=ncode;
result=dr["nationname"].tostring()
return result;}

 

posted @ 2017-11-16 18:48  sistrong  阅读(138)  评论(0编辑  收藏  举报