ASP Free has written a great article on how to update a database using a SqlDataSource programmatically which is much better, in my opinion, than embedding it in the ASPX file.
In the previous article we talked about using the SqlDataSource control programmatically to obtain a result set from the database using a Data Reader object and a Data View object. We used an HtmlTable control to create a visual representation to hold the returned result set. Today we are going to use the SqlDataSource control to insert data into the Employees table of the Northwind database.
In case you haven’t read the previous article I will show you the relevant code from it again, but I advise you to read the complete article when you can. Meanwhile, before we learn how to insert data, let’s run a similar version of the previous article’s code again. Next is the complete code for the code behind the Default.aspx.cs file…
Did You Enjoy This Post?
Be sure to grab my RSS feed so you don't miss out on more great articles.
This Post Was Brought To You By
How do I save time? I use FreshBooks for invoicing.
Get Information Technology magazine subscriptions and white papers for FREE!
Programmatically Updating Databases using ASP.NET 2.0 SqlDataSource

Did you like this post? Be sure to

Recent Comments