我正在开发基于Visual Studio 2008在.NET精简框架为Windows CE平台的移动应用程序。 我使用vb语言
i am developing a mobile application on visual studio 2008 under compact framework for windows ce platform. i use vb language
我想添加一个新行使用的BindingSource对象的数据表。 我的code是
i want to add a new row to datatable using Bindingsource object. my code is
Me.BindingSource1.AddNew()
Me.BindingSource1.AddNew()
Me.StokBindingSource1.Current(ID)=01
Me.StokBindingSource1.Current("id") = "01"
当我使用的BindingSource的当前methot提示错误 并说在.NET Compact Framework的目标版本不支持后期绑定
when i use Current methot of bindingsource it gives error and says The targeted version of the compact framework does not support late binding
我怎么能确定该领域增加值?
How can i determine the field to add a value?
推荐答案嗯...你想通过BindingSource的补充? 我建议尝试更新原始数据源本身,而不是再调用BindingSource的.RefreshBindings(假)。
Erm... you're trying to add via the bindingsource? I'd suggest trying to update the original datasource itself instead and then calling .RefreshBindings(false) on the BindingSource.
例如。 (伪 - 抱歉,这是C#)
e.g. (psuedo - sorry it's c#)
MyDataTable table; BindingSource source; SomeKindOfInit() { table = new MyDataTable(); source = new BindingSource(); source.DataSource = table; datagrid1.DataSource = source; } AddSomeStuff() { DataRow row = table.NewRow(); row["Id"] = "01"; table.Rows.Add(row); source.RefreshBindings(false); }
类似的东西反正....出于兴趣......你为什么要手工输入的ID?通常,人们会得到这个从数据库......不是吗?
Something like that anyway.... out of interest... why are you manually entering in the id? Typically one would get this from the database... no?
更多推荐
在.NET Compact Framework的目标版本不支持后期绑定的警告?
发布评论