|
-
Jul 23rd, 2006, 09:32 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] [2005] Set Form to DataSet
Its is possible to set a form to a particular DataSet?
I have created a DataSet related to a database I have connected to my project. I want to now create a form that uses this particular dataset kinda like in Access you can set the form to a RecordSource of some Sql Statement or Table, then everything on the form will be related to that table.
Is this possible if so what property do I need to set? I did read something about a form wizard but cannot seem to find it in VS2005.
Thanks
-
Jul 23rd, 2006, 10:11 PM
#2
Re: [2005] Set Form to DataSet
All sorts of controls can be bound to all sorts of data. One of the most common scenarios is binding a DataSet to a DataGridView. To do this you simply assign the DataSet to the grid's DataSource property and the name of the table you want to display to the DataMember property. There are all sorts of ways to display data in controls. VS 2005 has numerous tools to help you do this in the designer with zero code. A good place to start would be the Home & Learn tutorial in my signature, which gives a simple example. You could then check out some of the other tutorials and also search for "data binding" on MSDN and Google.
-
Jul 23rd, 2006, 10:38 PM
#3
Thread Starter
Fanatic Member
Re: [2005] Set Form to DataSet
Good point jmcilhinney I was jsut curious if you get set a form to a dataset like you could in .NET 2003.
Thanks
-
Jul 23rd, 2006, 10:46 PM
#4
Re: [RESOLVED] [2005] Set Form to DataSet
You couldn't "set a form to a dataset" in 2003. If you're talking about the Data Form Wizard then that was just a way of building a form with some controls already added and the data-binding a DataGrid already set up. VS 2005 uses the Data Sources window to create much more sophisticated relationships between data and controls, plus allows you much more flexibility. For instance, once you have added a Data Source to your project you can simply drag a field from it onto a form and the appropriate type of control will be added and bound to that field. The data access capabilities of VS 2005 are very advanced, or you can chosse to do some or all of the work yourself in code to maintian more control. All up, very powerful and very flexible.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|