2003升级到2008,新的数据控件 [英] 2003 upgrading to 2008, new data controls

查看:85
本文介绍了2003升级到2008,新的数据控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从Visual Studio 2003升级到Visual Studio2008.

我对如何升级项目有疑问.

我的项目在Visual Basic.Net中,并且正在使用Access 2003数据库.我有四个数据集,MainDataSet(用于主数据表)LookupDataSet(用于状态,国家,颜色等查找表)OneFormDataSet(仅用于一种形式的数据)和ReportsDataSet(用于报告的数据).

我有一个表格"OleDbAdpatForm.vb",其中包含我项目的所有OleDbDataAdpaters.它还具有DataSet和OleDbConnection.

我具有一些公共函数,这些函数使我能够加载数据表.当我可以传递列和值时,我具有LoadTable函数,并且使用WHERE或HAVING更新了SQL select命令,因此仅选择了请求的数据.我还可以传递SQL select命令的整个"WHERE…"部分,因此在SELECT命令中可以有多个参数.

在其他表单上,我具有数据集的副本,因此可以设计网格/控件.在form_Load事件中,我将控件手动绑定到位于"OleDbAdpatForm.vb"中的数据集和表,因此所有表单都使用相同的数据表,对一种形式的数据所做的更改将反映在其他形式的数据中. VS 2008的DataSources,BindingSources和TableAdapters似乎更易于使用.

我的问题是如何在应用程序中实现新的数据功能?

谢谢

I am upgrading from Visual Studio 2003 to Visual Studio 2008.  

I have a question on how I should upgrade my project.

My project is in Visual Basic.Net, and using an Access 2003 Database.  I have four datasets, MainDataSet (for the main data tables) LookupDataSet (for lookup tables States, Countries, Colors, etc)  OneFormDataSet (data used on only one form) and ReportsDataSet (data used for reports).

I have one form "OleDbAdpatForm.vb", that has all the OleDbDataAdpaters for my project.  It also has the DataSets and the OleDbConnection.

I have public functions that enable me to load the data tables.  I have a LoadTable function when I can pass a column and a value, and the SQL select command is updated with a WHERE or HAVING, so only the requested data is selected.  I also can pass the whole "WHERE …" part of the SQL select command, so I can have multiple parameters in the SELECT command.

On my other forms, I have copies of the DataSets, so I can design grids/controls.  In the form_Load events, I manually bind the controls to DataSets and tables in located "OleDbAdpatForm.vb", so all forms are using the same data tables, and changes made to data in one form are reflected in data in other forms.

The VS 2008’s DataSources, BindingSources and TableAdapters seem much easier to use.  

My question is how I should implement the new data features in my application?  

Thanks

推荐答案

您当前使用的方法在VS2008中同样适用,如果只是升级.但是,如果要重写应用程序,则可以考虑更改方法. BindingSource和BindingNavigator用于直接绑定UI控件,并使用这些绑定控件对数据库进行更改.
The approach you are currently using would work in VS2008 as well and you should keep use it if just upgrading. But if you want to rewrite your app then you can think of changing the approach. BindingSource and BindingNavigator are used to bind UI controls directly and make the changes to the DB using these bound controls.


这篇关于2003升级到2008,新的数据控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆