Modify a SQL entry with visual basic 2005

This is my first attempt to connect to an SQL database and make some changes.   I need to find row, then change a value.  I have my project setup to make the SQL connection and I can see the data.  This is a console app that will run and make changes to the database.

So my row will look like

Serial number | Info | Available

So I need to find the row by finding the serial number, and then make a change to the available column.  How would I set that up?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Your question is very simple, but need an some reference to get understand

Please feel free to walk throgh the URL and after this, if you need more info/assistned please revert back
Here is a simple example

Imports System.Data.SqlClient
Dim dbcon As New SqlConnection("your connection string")
Dim dbcmd As New SqlCommand
dbcmd.Connection = dbcon
dbcmd.CommandText = "Update tablename Set columnname=value Where columnname=value"
chadmanvbAuthor Commented:
I'm trying this, but getting an error when making the change.  I have a datagrid view and can see my data when I start the application.  I have a button that I'm using to test my change.  Workstations is my table name, Name is my serial number and also textbox2.text, and Description is what I want to change my value to and also textbox2.text.  I think I have the correct connection string, I cut/pasted that from my data connection.  Here is the code I have for the button.

 'write db
        Dim dbcon As New SqlConnection("Data Source=TestServerSQL;Integrated Security=True")
        Dim dbcmd As New SqlCommand
        dbcmd.Connection = dbcon
        dbcmd.CommandText = "Update Workstations Set DESCRIPTION=" & TextBox1.Text.Trim & "Where NAME=" & TextBox2.Text.Trim

The error is incorrect syntex near name.
Exploring SharePoint 2016

Explore SharePoint 2016, the web-based, collaborative platform that integrates with Microsoft Office to provide intranets, secure document management, and collaboration so you can develop your online and offline capabilities.

For columns of type varchar, values need to be enclosed in ' ' so try

Also, when concatenating, make sure you add spaces as your query was missing a space before Where.
dbcmd.CommandText = "Update Workstations Set DESCRIPTION='" & TextBox1.Text.Trim & "' Where NAME='" & TextBox2.Text.Trim & "'"

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
chadmanvbAuthor Commented:
Yippee, it worked!  Thanks so much.  I'm sure this will lead to a bunch more questions soon.
Glad to help :-)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.