Updating a Database from WinForms Controls Apollo PA

Old school programming, whereby the programmer reads control values and writes inline SQL, still works, but it's so 90s. If you are new to WinForms or Web programming but experienced, peruse the article and then master LINQ.

Local Companies

Innovate Software
412- 681-3000
160 N Craig St
Pittsburgh, PA
Horizon Information Systems
(814) 535-7810
435 Napoleon Pl
Johnstown, PA
Ron's Computer Service
(412) 349-6972
5706 Cox Ave
Pittsburgh, PA
Carlisle Group Inc
(570) 963-2036
544 Jefferson Ave
Scranton, PA
Corporate Solutions
(412) 731-3141
1501 Ardmore Blvd Ste 602
Pittsburgh, PA
DIVIUM, LLC
724-858-1422
645 E Pittsburgh St.
Greensburgh, PA
Psychology Software Tools Inc
412- 271-5040
2050 Ardmore Blvd
Pittsburgh, PA
Pro Tech Resources
(610) 695-9300
1770 E Lancaster Ave
Paoli, PA
Avysion
(717) 546-0020
29 S Union St
Middletown, PA
Rabbitdev Corporation
(717) 765-8328
350 S Potomac St
Waynesboro, PA

Introduction



So much about programming technology changes and a lot of it stays the same. One reader wrote and asked me how to update a database from WinForms controls (not a grid), writing SQL inline. I haven't used this approach in a while, so I had no ready-made examples. I did whip one up and send it to him, though. Another reader wrote and told me that my Sieve of Eratosthenes prime number algorithm sucked (his word, not mine), but after he told me that he had been writing it and re-writing it for 40 years I didn't feel so bad.

Of all of the reader email I get, just these two things alone reminded me that of course I don't know everything, and many of you are working at a widening level of experience. To that end, this article is an old school article that shows new-to-WinForms programmers how to read data from controls and contrive SQL that updates a database.

I would encourage anyone reading this article, working at this level, to immediately upgrade to stored procedures very quickly and then move on to LINQ. Inline SQL works fine, but it's so 90s. LINQ, LINQ to SQL, LINQ to Entities, and declarative programming will help you be much more productive and are much cooler technologies.



Describing the Scenario



Maybe you are a FoxPro programmer or one of the dwindling numbers of COBOL or assembler programmers finally moving over to Web and Windows programming with .NET, or maybe you are just getting started. (We were all there once, and in this business everyone is just getting started with some new technology—like Ruby, F#, or LINQ to Entities.) The challenge is how to get data from a WinForm control (or controls) into your database. The way you can do it (but fewer of us will going forward) is to read a value, format it as part of a SQL query, and invoke the SQL command.

Read the Rest of this Article at Developer.com

Featured Local Company

DIVIUM, LLC

724-858-1422
645 E Pittsburgh St.
Greensburgh, PA
http://www.divium.com

Related Local Event
Tech U: Excel
Dates: 3/13/2010 - 3/13/2010
Location: PA CareerLink Allegheny West Robinson Plaza Two
Pittsburgh, PA
View Details

Topics: 
Architecture & Design Languages & Tools Project Management Web Services
Database Microsoft & .NET Security Wireless
Java Open Source Techniques XML