ASP.net newbie - Insert records

M

M. Ali Qureshi

Hi,

I am very new to .net and sorry if my following question is a bit stupid...
I've been watching alot of video tutorials on asp.net, which are very good
to get started.

Most of these videos are build around the standard controls of .net (grid
view with editing, or form view etc etc..). I would like to know a simple
example of inserting records in database, without the ability of
viewing/editing all the others like in form view control.

for example, a form with some text boxes and a couple of drop down lists
(which are filled by ObjectDataSource control from database). Is there a
server control i could use to insert, or will it be a simple html form which
should be posted to another aspx page and we should retreive values and
insert? Can someone give me a very simple example of insert from
asp.net(vb)? I'm trying to stick to Data Access Layer / Object Data Source
model.

Thanks in advance

/MAQ
 
A

Aidy

You don't have to get controls to do everything for you, you can write code
too :) What you do is put asp:textbox controls on the page to gather your
input, then when the form is submitted you use ado.net to insert a record
into the table on your database.
 
M

M. Ali Qureshi

Hello Aidy,

Yes, you are absolutely right. But the problem is that most of the "learning
material" for beginners is all based around controls. I would very much like
to see some examples of code for data handeling in different scenarios
(insert, update, delete, stored procedures etc...)

Do you know any good examples of ado.net somewhere? Not its documentation,
but real-life examples :)

Regards

MAQ
 
S

sloan

http://www.asp101.com/samples/db_add_aspx.asp


One way to do a "basic" is like this:

1. Read your data. Putting your data into a dataset (preferably a
strong/typed dataset) .. and then reading that data from the dataset to
populate ddl's, textboxes etc on your web page.
2. Collect your data from the form.
3. Push the data ...into some class/method to save, and use the code above
to save the data to the database.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top