ASP.NET

25 pts.
Tags:
ASP.NET
Microsoft Visual Studio
SQL Server 2005
I have four textboxes and a database which 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:

Imports System.Data.SqlClient

You will also need SqlConnection and SqlCommand 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: 2  Replies

 
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
  • ToddN2000
    You will probably will want to use an OnChange event to fire off your SQL insert commands. Use the connection method listed above.

    15,605 pointsBadges:
    report
  • hunshabbir7
    I think he has clearly mentioned about OnClick event in question.
    2,630 pointsBadges:
    report

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