I have information entered into a text box on an ASP.net 3.5 page. when i click the submit button i would like this information written to a sql server database.
Can someone please tell me what I need to do to accomplish this. The end-user should not see anything.
I am using visual web developer 2008. the event handling code is placed in a separate file using vb.
Thank you.
There are lots of different ways to accomplish this: Dynamic Data, LinqToSQL, Typed data sets, Data Access Application Block, or another ORM. My preferred method is direct sql, which would use code something like this:
A few things to take from this sample:
UsingblockgetConnectionString()is private. You should abstract out your data access to a separate class or assembly, and this is one way to start enforcing that.