Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

newbee problems with update and set

$
0
0

Hi guys, super Newbee here i've been looking over my code for an update button and keep getting an error"syntax by set"

private void btnUpdate_Click(object sender, EventArgs e)
         {
             SqlCommand sComm = new SqlCommand(" update Customers " +
                 "set CompanyName ='" + tboxCompanyName.Text + "', " +
                 "set ContactName ='" + tboxContactName.Text + "', " +
                 "set ContactTitle ='" + tboxContactTitle.Text + "', " +
                 "where CustomerID='" + tboxCustomerID.Text + "'", conn);
             sComm.ExecuteNonQuery();
             

         }

Can someone see what i'm doing wrong.  I've got a delete, next, previous, first, last buttons as well , they work fine but this one is giving me a headache.  THANKS


Viewing all articles
Browse latest Browse all 12583

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>