Click here to Skip to main content
15,890,512 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
i have some problems with my code.
VB
Dim sql As String
       Dim MySQLConnection As MySqlConnection
       MySQLConnection = New MySqlConnection
       MySQLConnection.ConnectionString = "server=127.0.0.1;Port=3307; User ID=root; password=qweqwe; database=test"
       MySQLConnection.Open()
       sql = "DELETE FROM online"
       Dim da As New MySqlDataAdapter(sql, MySQLConnection)
       Dim cb As New MySqlCommandBuilder(da)
       MySQLConnection.Close()

I can connect to mysql do selections query and so on but i can't insert or delete row what is the problem thank you.
Posted

You're not actually executing your delete query with the code you have. Take a look at this[^], which uses the MySqlCommand (not MySqlCommandBuilder) for executing an insert, update, or delete query.
 
Share this answer
 
your query is not complete - add a where clause in your query. and execute it.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900