最新评论

侯伟华 2011-12-17 09:15
学习一下
ITMelody 2011-11-17 13:01
谢谢,学习ndk的资料真的好少,基本上都是环境搭建的,我应该怎么学呢,请楼主赐教.
双击 2011-08-03 09:57
帮顶
MaoBisheng 2011-08-03 09:55
陈老师辛苦了
chukunpeng 2009-11-20 17:42
BindingFieldAttribute 您能吧这个类的设计给我看一下吗,不明白
杜宏雷 2009-09-07 17:13
什么是垂直反射?
cylx00 2009-07-23 12:07
我使用后,出现程序集未标记为可序列化?不知道什么原因?
lqx 2009-04-24 15:54
你好 请问 BindingFieldAttribute是什么类啊 具体属性?
榕城小榕 2009-03-31 10:18
--引用--------------------------------------------------
MHL: 这样效率会不会有问题。
如果一个属性是arraylist或是其它的集合类要怎么处理?

--------------------------------------------------------
可以再传一个参数,专门对你的其余属性操作,如用Hashtable


我想请问楼主
T RowInstance = Activator.CreateInstance<T>();

与 T RowInstance =default(T);区别,谢谢!
qq63795055 2009-01-09 11:04
这样搞定排序更简单,呵呵
/// <summary>
/// 设置用户
/// </summary>
private void SetUser(List<UserEntity> userList)
{
this.ddlName.AutoPostBack = false;

this.ddlName.DataValueField = "ID";
this.ddlName.DataTextField = "Name";
userList.Sort(delegate(UserEntity left, UserEntity right) { return left.Name.CompareTo(right.Name); });
this.ddlName.DataSource = userList;
this.ddlName.DataBind();

this.ddlName.Items.Add(new ListItem(string.Empty, "-1"));
this.ddlName.SelectedValue = "-1";
}
Collum1 2008-10-15 11:46
自定义的类作为Entity的属性,这种情况如何排序呢?
比如有一个类:ClassA,其中有属性P1,P2,如何使用P1对Entity的集合进行排序呢?谢谢
saloough 2008-08-20 10:56
只好用Reflector看看源代码了。
这句话不是有提示了吗?
吴潮槟 2008-08-09 09:39
效率很差,每一次反射都需要很多资源,数据上万条之后就非常明显了。最好DataSet出来,然后采用垂直反射,,性能会好一点
MHL 2008-07-27 19:08
这样效率会不会有问题。
如果一个属性是arraylist或是其它的集合类要怎么处理?
westmylove 2008-05-30 18:13
你好,问下怎么看到CreateInstance 这个的源码的啊?
谢谢。
qq564878494 2008-01-15 00:20
public static List<BusinessObject> Deserialize<BusinessObject>(string XmlStr)
这个List<BusinessObject> Deserialize<BusinessObject>(是这个方法的名称吗
qq564878494 2008-01-14 23:49
这是泛型List<SerialEmployee> emp = new List<SerialEmployee>();

这是泛型中的对象public class SerialEmployee
{
public int EmployeeID;
public string LastName;
public string FirstName;
public int YearsService;
public double Salary;
public SerialEmployee(int EmployeeID, string LastName, string FirstName, int YearsService, double Salary)
{
this.EmployeeID = EmployeeID;
this.LastName = LastName;
this.FirstName = FirstName;
this.YearsService = YearsService;
this.Salary = Salary;


}
我将这泛型中添加数据后,发生到远程客户端
我该如何反序列化它,然后来读取泛型中的成员!
问题补充:emp链表中的对象SerialEmployee在
emp.Add(new SerialEmployee(1, "cehnli", "Li", 33,43.44));
这后,序列化,通过socket发送到对方主机,对方主机应该如何反序列化它
他是c#的应用程序
cao 2007-07-24 14:56
xie shen ma niao b
freeliver54 2007-07-17 16:16
HAO!
water 2007-05-21 16:50
我也遇到同样的问题,其他高手解答!
kchen 2007-03-18 15:25
我是给实体类的属性里加了customerAttribute了, 所以要取到对象的所有属性,你要做的话,不用关注这个就ok了..
清 2007-03-17 21:02
foreach (BindingFieldAttribute FieldAttr in Property.GetCustomAttributes(typeof(BindingFieldAttribute), true))
{
try
{
//取得当前数据库字段的顺序
int Ordinal = reader.GetOrdinal(FieldAttr.FieldName);
if (reader.GetValue(Ordinal) != DBNull.Value)
{
//将DataReader读取出来的数据填充到对象实体的属性里
Property.SetValue(RowInstance, Convert.ChangeType(reader.GetValue(Ordinal), Property.PropertyType), null);
}
}
这一段由于我没有BindingFieldAttribute这个类所以一直没弄清楚我将他改为了
property.SetValue(instance, Convert.ChangeType(dr[property.Name].ToString(), property.PropertyType), null);能运行正常,请问你那样写有什么原因吗?
清 2007-03-17 17:32
好文章,帮大忙了
黑糊糊 2007-02-03 17:40
可以用吗?不能用
trueworld 2006-11-16 16:52
不错,拿来就可以用了
T.t.T!Ck. 2006-11-15 15:08
good good
我来支持一下...够实用
东吴居士 2006-11-14 10:31
好文章!!
T.t.T!Ck. 2006-10-31 00:20
嘿嘿 不太懂.
告诉我这样做有什么好处?
^_^
goto_116 2006-10-26 13:35
很有收获!!!:)
151315612161 2006-08-19 22:28
*****************************8
while(reader.Read())
{
UserInfo UserInfo1 = new UserInfo();
UserInfo1.id = reader["id"].ToString();
UserInfo1.UserName = reader["username"].ToString();
UserInfo1.PassWord = reader["password"].ToString();
UserList[i] = UserName1;<<<<----------------
i++;
}

**********************************
这其中的UserName1是那里来的?
我还有一个问题:
我做这个的时候,使用的ACCESS数据库,但是当点击调用的时候会出现500错误,是怎么回事?


公告

新浪微博:

http://weibo.com/kchen30

昵称:kchen
园龄:5年9个月
粉丝:5
关注:1
<2012年2月>
2930311234
567891011
12131415161718
19202122232425
26272829123
45678910