Solved

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

Posted on 2008-09-29
2
574 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

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

10 Experts available now in Live!

Get 1:1 Help Now