码迷,mamicode.com
首页 > Web开发 > 详细

ADO.NET面向对象 属性扩展

时间:2017-11-16 19:46:31      阅读:216      评论:0      收藏:0      [点我收藏+]

标签:ado.net   code   对象   get   扩展   nat   ati   use   name   

例:
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;}

 

ADO.NET面向对象 属性扩展

标签:ado.net   code   对象   get   扩展   nat   ati   use   name   

原文地址:http://www.cnblogs.com/sistrong-5880558/p/7845817.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!