A group blog from members of the VB team
This was one of the hardest decisions we had to make. We know this is a very intuitive way to work. I’ve got my database, and I want it on my form (period).
First, lets look at what we had in 2002, 2003. In 2003 you could drag from Server Explorer to your form, but we didn’t give you textboxes and labels. We gave you an untyped, configured DataAdapter
So, in comes Whidbey features where we now can create controls, labels, name them, and databind them. See the Sept/October issue of Code-Magazine.com for my article on Drag Once DataBinding. Note: you do need to have a subscription to view the whole article, but hey, code is a great magazine J Once an article is two months old, they open it up to the public…
Here’s the problem
In order to give a complete experience we’re creating typed DataSets and Typed DataAdapters that are shared throughout the project.
Here’s the scenario:
When you dragged the columns from Server Explorer to your form, behind the scenes we created a Typed DataSet and a Typed DataAdapter. We then instance these on the form and databind controls to them. So far, so good.
When you dragged additional columns to Form2, we have a choice.
We experimented with some dialogs prompting the user to help us make the right decision about merging or creating new datasets or datatables, but the experience just wasn’t that great so we decided to just scale back.
So, ultimately, the entry points aren’t as intuitive. …but we won’t mess with your perfectly working forms as you continue to build the project. We should also keep in mind that while dragging from Server Explorer to the form is intuitive, it isn’t as feature rich. For instance, developers don’t have a way to choose their default control; Textbox, DateTimePicker, DataGridView, ComboBox or even their own custom control.
We did discuss merging much of the functionality from the Server Explorer with the Data Sources Window, but that would only be Database centric. Where would you drag Objects from? The most obvious is the class designer. So, then we wind up with anarchy… I��m dragging from everywhere. Gee, that actually sounds like what Microsoft would normally do. J Seriously, that’s actually a great idea, but it just wasn’t feasible to get all this dev’d and tested and still ship the features we have. It’s also not necessarily the “right” thing to do in the big picture. If you look at the Data Sources Window, (especially when we ship Beta 2), compared to Server Explorer and the Class viewer, their each targeted at their basic usage design. It was far more controlled to create a single collection of Data Sources that we could put all the Custom Controls and Relation semantic in.
Explaining the Data Sources Window and Server Explorer
Think of Server Explorer as all the Databases within your enterprise across multiple departments. If your consultant, you might have Database connections for several customers. This list isn’t specific to a project…
Think of the Data Sources Window as what’s available within a specific project. The “shape” of the DataSource may be different within your project then it exists at the source. For instance it’s fairly common to join a table within a DataSet to list the Name as well as the foreign key id. The Server explorer would only show that if you had a View or Sproc.
With the above complications of expectation compared to our typed DataSets and DataAdapters we felt it was better to be more explicit then magical.
The expectation is developers will pull in Data Sources from their enterprise into the Data Sources Window. They may be database connections, queries, etc. from various different locations, object references from dll’s from my company, or web services from around the world.
The Data Sources Window will consolidate all the available Data Sources for the active project.
Data Design-Time for Client Apps
Blogs @ http://blogs.msdn.com/vbteam/category/4754.aspx
了解类型化 DataSet 类中的新特性、Visual Studio 2005 生成的新 TableAdapter 类，以及设计这些类的工具。此外，了解新 BindingSource 和 BindingNavigator 组件，理解如何使用它们快速构建灵活的数据绑定 WinForms 应用程序。
PingBack from http://restaurants.247blogging.info/?p=635
Visual Studio 2005 中的新的 DataSet 功能
PingBack from http://caferestaurantsblog.info/the-visual-basic-team-why-cant-i-drag-from-server-explorer-to-my-form/
PingBack from http://crockpotrecipeblog.info/the-visual-basic-team-why-cant-i-drag-from-server-explorer-to-my-form/
PingBack from http://indoorgrillsrecipes.info/story.php?id=2218
PingBack from http://fixmycrediteasily.info/story.php?id=14761