如果你做ado.net,你一定想知道绑定字段的长度(设计状态下也可以的)
public int GetFieldLength(Binding binding){
BindingSource bs = binding.DataSource as BindingSource;
DataSet ds = (DataSet)bs.DataSource;
return ds.Tables[bs.DataMember.ToString()].Columns[binding.BindingMemberInfo.BindingField].MaxLength;
}
[[it] 本帖最后由 heyu52 于 2008-4-16 00:14 编辑 [/it]]