Solved

SQL Data Source for Windows Forms (Applications)?

Posted on 2008-06-14
2
1,558 Views
Last Modified: 2013-11-27
Heya

I've recently started playing around with building windows apps using VS2008 and although I can code sql connections, commands etc. manually there doesn't seem to be something like the SQL Data Source manager you get when building web apps. I see the Dataset can hold queries for you but it all seems a bit code heavy. Can anyone point me towards some good tutorials for building data connected based windows apps with SQL server?

The SQL Data Source in web apps has optimistic concurency, couldn't see anything like this in dataset, I take it this would have to be coded manually in a windows app?

Many thanks!
0
Comment
Question by:garethh86
2 Comments
 
LVL 34

Accepted Solution

by:
Sancler earned 500 total points
ID: 21787996
As I don't do Web apps, I may be on the wrong tack, but it sounds to me as though the equivalent to what you're seeking in WinForms is provided by the Data Sources tab in Solution Explorer.  If, on that, you click on Add New Data Source it will run a Wizard enabling you to choose a server, database, tables, etc and the the Designer creates the necessary objects - dataset, connection, adapters.  Although the auto-generated code is based on DATAAdapters, it "wraps" them up in TABLEAdapters: that means they are less familiar.  If you prefer to work with DATAAdapters directly, there is a configuration wizard for those, too.  In the Toolbox, right click on the Data tab and then on Choose Items ... and select an SQLDataAdapter.  When that has appeared in the Toolbox, if you drag it to your form it will start the wizard for that.

As to Optimistic Concurrency, that's the default approach in ADO.NET.  This is a good starting point.

http://msdn.microsoft.com/en-us/library/aa0416cz.aspx

Although that describes how to implement it in code you will, if you use any of the wizards to configure data sources and then examine the code the designer produces, find that that is the approach that they implement.

Roger
0
 
LVL 7

Author Closing Comment

by:garethh86
ID: 31467168
Nice one, thanks, played around with this is VS and it is fairly similiar, I first went in, didn't see sqldataadapter and panicked!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now