ASP.NET - insert form data into Access Database

PHTech

Senior Member
Joined
Aug 21, 2006
Messages
588
Reaction score
0
Location
Witbank
Hi there...

It seems that if you figure out one thing in ASP.net, you run into another thing almost impossible to accomplish...

OK - Using Visual Studio 2008 and creating the front-end (or most of it) using Dreamweaver CS4...

I want to know, how can I insert data in a database using a simple web form...? I have came across other links in Google with similiar posts, but nothing which can explain it to me as I am still new with ASP.net (VB). I have managed to insert something in another page which you can view, edit and delete data records from the Access DB, but don't know how to handle the task at hand...

I do not use any ODBC connections for the Access DB as it seems VS2008 have the ability to work directly with the Access DB...

Any links to good tutorials also welcome...!

Thanx alot...!
 
ok so let me translate the question :D

you want to write and read data from a database using vs2008 ?

basically in short what you could have is

' carrier object ' class with the values in it and to be used by the code instead of passing a ****load of parameters each time.
' data object ' class which does the actual reading and writing of data from (via sql reader) and to (via sql command) the data base.

ea.

userCO;
private variables shared via properties and set from the public constructor

userDO;
userDO.SaveRecord which takes a userCO object to read values from and saves to DB
userDO.GetUsers which return an array of userCO objects read from DB
 
Last edited:
Last edited:
example on the sqldatareader
http://www.aspfree.com/c/a/Database/ADO-NET-101-SqlDataReader/

could have looky here too
http://www.aspfree.com/c/b/Database/

basically you need

a) read data from DB, with for example the SqlDataReader
b) write data to DB, SqlCommand + execute non query

there is always the ado.net, but you don't always need that elephant of a methodology to do things.

I have found this website, but it only displays info to insert records into a SQL DB, and I am not going to use SQL for this excersize... http://forums.asp.net/t/1087504.aspx
 
I basicly need a tutorial of some kind to actually explain to me how this can be done... I don't know where to implement snippets of code... Still learning the ASP.net thing...
 
I have found this website, but it only displays info to insert records into a SQL DB, and I am not going to use SQL for this excersize... http://forums.asp.net/t/1087504.aspx

If you write your "carrier" and "data" object well enough, it shouldn't matter what database you connect to. You can start off with an Access DB and later on upgrade to SQL Server. It's called polymorphism. :)
 
If you write your "carrier" and "data" object well enough, it shouldn't matter what database you connect to. You can start off with an Access DB and later on upgrade to SQL Server. It's called polymorphism. :)

exactly. which will make transition/ineraction easier.
 
Good point. Add to that the option on Access DBs to allow for SQL-ready syntax, and there's really no excuse.
 
remember to at least add some form of validation and user input limitations; don't just expect the user to insert the correct values just becuase you would.
 
Oh noez! Don't tell me you used a WYSIWYG-editor to create that page layout! The CSS class-name "style1" kinda tells me so... Before even getting into the coding-side, please make sure you understand HTML fully.
 
you should learn how the page event works exectly- will help with when to do what.
 
To self: Walk away. Just walk away. Ignore the table layout, and walk away. :p

Necuno gave you a few good links in those search results. First result looks good, anyway. You shouldn't need to go further.
 
Oh noez! Don't tell me you used a WYSIWYG-editor to create that page layout! The CSS class-name "style1" kinda tells me so... Before even getting into the coding-side, please make sure you understand HTML fully.

That page's code I sent was for example only...! But I do use Dreamweaver CS4 mainly for the frontend, and Visual Studio 2008 Pro for the stuff that I am mostly struggling with (as Dreamweaver now removed all ASP.net functionalities within the program - so no support from Macromedia :o )...

But in my previous post, you are welcome to follow the link of one website I have designed for a client, using NO tables, and have one CSS file. All pages are HTML, so I personally think I haven't done a bad job... ;)
 
Top
Sign up to the MyBroadband newsletter
X