asp316
asked on
Best practice to read, insert, update SQL data in Visual Studio - Winforms?
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!
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!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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)