Click here to Skip to main content
12,690,575 members (33,477 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: VB ADO.NET MySQL VB.NET
Okay so I need to find out if any of this is possible and the code needed.

I'm using MySQL and need to know how to create, delete, move entries, check if they exist, search / filter results with containing strings, link tables and updating results.
Any other functions would also be useful to me but the ones above are essential.

I'm using ADO.NET MySQL Connector in VB.NET.

Thank you for any help.
Posted 8-Jan-13 9:43am
Updated 8-Jan-13 10:35am
v3
Comments
   
Everything is good, except one part: "I'm using MySQL". I think this is a huge exaggeration.
—SA

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

All of this is basic SQL, as far as I can tell. What do you mean 'the code needed' ? We can't write code based on these vague requests. Do you know SQL ?
  Permalink  
Comments
jackdawkc 8-Jan-13 15:09pm
   
Yeah sorry, I meant something like this for each:
Dim DatabaseConnection As New MySqlConnection("Server=173.254.28.25;Database=antivuru_Rozzle;Uid=antivuru_Rozzle;Pwd=passwordexample")
Dim Query As String = String.Empty
Dim SQLCommand As MySqlCommand
Dim DataReader As MySqlDataReader

Query = "INSERT INTO users (Username,Password,Email_Address,Full_Name,Join_Date) " & _
"VALUES ('" + TextBox1.Text.ToLower + "','" + TextBox2.Text + "','" + TextBox3.Text + "','" + TextBox4.Text + "','" + Date.Today + "') "
SQLCommand = New MySqlCommand(Query, DatabaseConnection)
DatabaseConnection.Open()
SQLCommand.ExecuteNonQuery()
DatabaseConnection.Close()
MsgBox("Done")
Christian Graus 8-Jan-13 15:11pm
   
Well, that code is a disaster. you should read up on SQL injection attacks, and parameterised queries. Along the way, you'll see how to run any SQL you like.
jackdawkc 8-Jan-13 15:13pm
   
Where can I read up on these?
Christian Graus 8-Jan-13 15:25pm
   
http://blog.divergencehosting.com/2009/04/09/using-parameters-parameterized-queries-database-interactions-cshar-vbnet/ Google even auto completed it for me, it's searched for that often

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.170117.1 | Last Updated 8 Jan 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100