473,406 Members | 2,293 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

How to update all the name that display in datagridview

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
1 1035
Rabbit
12,516 Expert Mod 8TB
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

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

Similar topics

1
by: gaya12 | last post by:
I have a table called Student in a SQL databse.. I have to create a simple windows application in C# to Retrieve that table for the following functions.. 1.Add Data 2.Update Data 3.View Data ...
3
by: sampalmer21 | last post by:
Hi, If I update a cell in the DataGridView control, I use the DataAdapter.Update(DataTable) method to update the database, but when I restart the application my changes are not in the database....
0
by: Andrus | last post by:
I tried to edit data in DataGridView. Insert and delete operations in grid are not saved to database. Updating works OK. How to force grid to save Insert and Delete operations also ? Andrus....
8
by: kashifabbasi786 | last post by:
I want to change the DataGridView Heading on run time by giving in textbox. how i will do this,plz help me Thnx
1
by: adsaca | last post by:
here's my code in filling a datagridview,which i retrieve from database mysql, dim sql as String sql = "SELECT * FROM table_user" Dim myData As New DataTable ...
0
by: csharp learner | last post by:
I've populated the datagridview with an excel sheet and now i want to update the datagridview to a similiar table at Oracle DB. private void updateOracleBtn_Click(object sender, EventArgs...
0
by: bharathi228 | last post by:
Hi, iam working with windows application.here my requirement is binding data to database from a datagridview. next i want to update some rows in datagridview and update it to the database.for...
1
by: progvar | last post by:
Hi i want to update data in database using datagridview actually i am displaying the data in datagridview and after that i want to update some rows data directly modifying the displayed data into...
0
by: isitha | last post by:
guyz, i have a windows form class called "fuel" in this class i have used datagridview which is called "dataGridView1". It shows all the entries i insert to the database by using form "fuel".At...
4
by: medibatam | last post by:
I used the vb.net 2008 I want to set the header name of my datagridview when connect to my database. here is the problem.. field name of database is "item_code" also show the same in data...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.