Avatar of jglazer63
jglazer63 asked on

Best way to execute an SQL update command.

I am somewhat new to .net and trying to decipher the best way to execute a simple

UPDATE MYTABLE SET MYFIELD=1

SQL statement within VB.Net.  I already have a SQL Connection :

dim cn as new SQLClient.SQLConnection(ConnString)

Can someone give me some advice here?
Visual Basic ClassicVisual Basic.NET

Avatar of undefined
Last Comment
jglazer63

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Guy Hengel [angelIII / a3]

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Guy Hengel [angelIII / a3]

I guess however that you want to add a where clause to limit the rows to be updated?
check out the SqlParameter class, to make sure performance will be best and to avoid sql injection...
ASKER
jglazer63

Thats the ticket!
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23