Solved

Best practice to read, insert, update SQL data in Visual Studio - Winforms?

Posted on 2008-09-29
2
579 Views
Last Modified: 2013-12-17
I have a winform app that I'm developing in VS2008 for workstations running .net 2.x framework. What's the preferred method to insert / update/ read calls to SQL, especially when the displayed data resides in several tables? I'm getting my data by means of a stored procedure which joins the data together and need to save data back to they're perspective tables.

It seems to me there would be a really cool way of doing this. Right now, I'm considering just writing  stored procedures and letting them do the CRUD stuff. If that's the only option, what's the best way to call them while passing all of the params? Also, do you agree that splitting out all database access into it's own data access layer is a good practice?

Since the clients are running .Net 2, I'd rather not upgrade them to 3.5, which get's rid of linq. OR, is LINQ that cool to where it's worth the trouble? If so, can you give me some examples?

TIA!
0
Comment
Question by:asp316
2 Comments
 
LVL 53

Expert Comment

by:Dhaest
ID: 22604254
I see 2 possibilities that you can do:
1. Use a stored procedure and pass all the variables to your stored procedure
2. Create a sql-command object (for each sql-statement), add the parameters to that sql-command and perform them all together in a transaction. (perform this in a database-layer)
0
 

Accepted Solution

by:
asp316 earned 0 total points
ID: 22724948
I found subsonic! Very cool!!

http://subsonicproject.com/
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

770 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