By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,369 Members | 1,001 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,369 IT Pros & Developers. It's quick & easy.

How to update all the name that display in datagridview

P: 1
I have try this but it always give an error

Expand|Select|Wrap|Line Numbers
  1.  k = MessageBox.Show(DataGridView1.Rows(e.RowIndex).Cells(e.ColumnIndex).Value.ToString)
  2.             connection.Open()
  3.  
  4.             p = "UPDATE police_deployment_system.police_profiles SET POLICE_STATION_ID = """ & man & """ where police_deployment_system.police_profiles.POLICE_ID = """ & k & """ "
  5.             Dim cmd As MySqlCommand = New MySqlCommand(p, connection)
  6.             adapter = New MySqlDataAdapter(p, connection)
  7.             adapter.Fill(ds)
  8.             command.CommandText = "Select * from police_profiles"
Mar 24 '14 #1
Share this Question
Share on Google+
1 Reply


Rabbit
Expert Mod 10K+
P: 12,365
You need to give us the error message.

But if I had to guess, it's because you're using double quotes for your SQL query when SQL uses single quotes for strings.
Mar 24 '14 #2

Post your reply

Sign in to post your reply or Sign up for a free account.