AspdotnetCodes.com
Search
Articles
Books
Resources
Asp.Net News
Downloads
Free Tech Magazines
Asp.Net Web Hosting
Archives
Softwares
Newsletter
Suggest Us
Link to Us
Feeds Subscription
Articles
Questions & Answers
Tips & Tricks
 Insertion Data through text boxes
Posted by M Jamil Akhtar on  7/22/2009 5:35:13 AM Category: ADO.NET
Add to my favorites
Email to friend
How to insert data in database using textboxes in ASP.Net 2.0

Post Your Reply Post New Question

 Viewer's Reply
Plz follow proper connection code!
Answered By RAJESH KUMAR VISHWAKARMA on 9/19/2009 12:57:27 AM
Please Write U Properly. where are u facing problem.?
Write Syntex.
Thanks
Rajesh
DELHI PRESS
 
Insert Data in Database through Text boxes
Answered By aadi on 12/28/2009 1:01:10 AM
first have to open connection
then
insert into emp values id '"+textbox1.text+"' sal = '"+textbox2.text+"';

also connection would be closed

hope it will be work
 
Try To Apply Following Code
Answered By RAJESH KUMAR VISHWAKARMA on 12/28/2009 2:31:21 AM
SqlConnection con = new SqlConnection("server=xyz;uid=xyz;pwd=xyz;databse=xyz");
SqlCommand cmd = new SqlCommand("insert into emp values('" + TextBox1.Text + "';'" + TextBox2.Text + "')", con);

after Above code Open Ur connection.




Note-: Don't forget to import Namesapce
using System.Data.SqlClient;

Good Luck1
 
Post Your Reply If you still have problem, post it again under this reply for better response.

 
Sponsored by
Simply SQL - Free 111 Page Preview!
Washington Technology
Take Advantage of Oracle's 2 Day DBA Course