Solved

SQL Data Source for Windows Forms (Applications)?

Posted on 2008-06-14
2
1,584 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
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 Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
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…

911 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

20 Experts available now in Live!

Get 1:1 Help Now