ASP.NET

25 pts.
Tags:
ASP.NET
SQL Server 2005
Visual Studio
i have four textboxes abd a database whicjh is already created. what i want to do is if i enter the value in the four textboxes and press button it should automatically gets updated or saved in the database.

Software/Hardware used:
visual studio web developer 2008

Answer Wiki

Thanks. We'll let you know when a new response is added.

You will need the SqlClient namespace:

<pre>Imports System.Data.SqlClient</pre>

You will also need <a href=”http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.aspx”>SqlConnection</a> and <a href=”http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.aspx”>SqlCommand</a> objects.

Your connection string would be something like this:

“Data Source=YourDatabaseServer;Initial Catalog=YourDatabase;User ID=YourDatabaseUser;Password=YourPassword”

In summary:

-Declare and instantiate your SqlConnection and SqlCommand objects
-Assign the appropriate connection string to the SqlConnection
-Assign the connection and the appropriate SQL command text to the SqlCommand
-Open the SqlConnection
-Execute the SqlCommand
-Close the SqlConnection

Happy coding !

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following