aspx web form to insert data in database MS Sql Server through insert button .

Posted by 0194ca071007 under ASP.NET on 12/24/2011 | Points: 10 | Views : 16234 | Status : [Member] | Replies : 2
hello '
I am creating an web application of storing records of student in a table using mssql server.
I had created a home page ,one insert page ,one display record page and finally a search
aspx page.Now I really want to know how to insert record into data base which I had created
by clicking the insert button on my insert .aspx page... plz do check and do the need ful .
For which I shall be highly Obelise to you
Thanking you .plz help me out soon .





Responses

Posted by: Arefin on: 12/25/2011 [Member] Starter | Points: 25

Up
0
Down
Hi,

You can follow the below link:
http://stackoverflow.com/questions/4762381/asp-net-using-a-form-to-insert-data-into-an-sql-server-table

Thanks,
Arefin

0194ca071007, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Self-innovator on: 12/25/2011 [Member] Bronze | Points: 25

Up
0
Down
If u want to store 3 values of student namely name age city try this in button click
public buttonclick()
{
string name=textbox1.text;
int age=convert.toint32(textbox2.text);
int city=textbox3.text;
SqlConnection cnn = new SqlConnection(Conn);
SqlDataAdapter ada = new SqlDataAdapter("insert into tablename values(name,age,city)",cnn);
DataSet ds = new DataSet();
ada.Fill(ds);
lblmessage.text="Records added successfully";
}

Join Hands Change lives
Thanks & Regards
Straight Edge Society

0194ca071007, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response