Some Tips When handle Dataset in VS 2005


Visual Studio 2005中文版还没出来,往往遇到一些提示,却无所适从,呵呵,记录之。


Concurrency violation: the UpdateCommand affected 0 of the expected 1 records
 
并发冲突
 
仔细检查Row的每个字段的变化情况。
 
Concurrency violation
 
Check the changes of every columns in the row.


DataSet Changes, while BindingSource Remains.
设计状态将BindingSource的DataSource属性设置为一个DataSet,并将其DataMember属性设置为DataSet中的一个表。
 
运行状态更改了DataSet,BindingSource并未随之改变,需要重新进行上面的设置。
 
 
Set the DataSource of BindingSource to a DataSet, and set it's DataMember attribute to the name of a DataTable in the DataSet.
 
While the DataSet is changed in running mode, the BindingSource do not change subsequently. Above settings in running mode are needed.


How to: DataGridView Cell Value Displayed in Percent Format
 
将列的DataGridViewCellStyle的Forma属性设置为"P2"(百分数老保留两位小数)。
 
我们知道如果设置DataFormatString的时候,应该设置为"{1:P2}",但是在设置DataGridViewCellStyle的Forma属性时需要指定为"P2"。
 
 
Set the Format attribute of the DataGridViewCellStyle to "P2" (2 fractions reserved).
 
As we know, when we set the value of DataFormatString, it should be "{1:P2}". But if it is for the Format attribute of a DataGridViewCellStyle, it should be set to "P2".


Deleted row information cannot be accessed through the row.
Deleted row information cannot be accessed through the row.
无法通过行访问已删除的行信息。
 
可能的原因:
一个DataRow已经被从DataTable中删除,然后又尝试获取DataRow(本身或字段值等)。
 
Reason:
Delete a DataRow from a DataTable and try to retrieve the row(the row itself or its fields' information).


posted @ 2006-01-18 22:06  蜡人张  阅读(2709)  评论(3编辑  收藏  举报