Click here to Skip to main content
16,008,010 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear all,
Which is the best method to insert data into the database?
I am using MSSQL and ASP.NET with C#

Please help! :confused:
Posted
Updated 27-Mar-10 4:13am
v2

1- Create stored procedure in the database and use them for database operations by passing desired parameters.

2- It you are not comfortable in writing stored procedures, and want to write direct query then in that case use parameterized queries.


3- For managing connections/command/transactions etc in better way, in C# you can use Data Block of Enterprise Library.
 
Share this answer
 
If you are working in Visual Studio 2008(Framework 3.5) then use Linq. it is very simple to use and we can perform operations in some lines and it is also fast.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900