hiii all,

I am developing a website with a webform in it.
i want that when user clicks the submit button ......all the data filled by user should come in my MS Access database table which have the same fields..

I have connected the database.

webform i have developed in asp.

any help will be appreciated..

Thank u

U should use POST action on webform on which there is Submit button

<form name="thisform" method="post" action="save_results.asp">

Where save_results.asp would have the code to save data to your data base.in this file open connection to your database.Use request.form to extract values entered by user in the webform.

eid=request.form("emp_id")

where emp_id is the NAME of your text box(or any field in which user has entered value)

Now u can use insert sql statement and insert values in ur database

str = "INSERT INTO employee(id) VALUES ('"& eid & "')"
conn.execute(str)

where employee is name of your table and id is name of the field in which you want to insert the emp_id value

Hope this is of some help :)

thanks...

yeah this is of a lot help...

I too get a solution in which i gave command on htmal page ..

<asp:Button ID="Button1" runat="server"
            OnClick="Button1_Click" Text="Submit" />

and on button1_click
i did open the connection and used sql query to save the data in my database...
it's working fine on local intranet.

but now i m thinking to change my code according to urs... i knew about 'post' but to give another commands on that asp page... that was the thing where i was stuck..

thanks once again..

can u tell me how to add a page in project with .asp extension...

every time m adding it's saying .aspx ...... is it the same thing??

when i changed extension from aspx to asp... then it said...... wrong extension.

can u tell me how to add a page in project with .asp extension...

every time m adding it's saying .aspx ...... is it the same thing??

when i changed extension from aspx to asp... then it said...... wrong extension.

.aspx is extension of ASP.NET files

okay thanks....

now just one last thing..

i made the whole form.. with a submit button.

now when I m trying to save the data..
in aspx page_load by

name=request.form("Text1")

where Text1 is the ID of my field NAME

but It is giving error that

"Text1 is not found in current context."


and when i remove the page_load section and establish the connection direct in the class.

then it's showing error at

connection.Open();

and

command.ExecuteNonQuery()

plzz help... this is the last thing...
thanks for ur time..

and also plzz tell me... that it should be a "get" method or "post" method...

because i read in W3School.com that it should be "get" if u r trying to retrieve the information on another page.

"post" mothod is used when u want to send an e-mail.

thanks once again..

form name="thisform" method="post" action="save_results.asp">
Where save_results.asp would have the code to save data to your data base

This article has been dead for over six months. Start a new discussion instead.