Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › Programming Tutorials › [Visual Basic]Edit Tables in mySQL

[Visual Basic]Edit Tables in mySQL

Posts 1–9 of 9 · Page 1 of 1
mnpeepno2
mnpeepno2
[Visual Basic]Edit Tables in mySQL
Velcomen to editing tbls in mySQL!

First import the mysql connector (download and extract below)
Then Add the reference: Projekt => Add Reference => Browse => Path of mySQL.Data.dll

Now we insert teh imports:
Code:
Imports System
Imports System.Data
Imports System.Windows.Forms
Imports MySql.Data.MySqlClient
Add some dims(under form1):
Code:
Dim conn As MySqlConnection
    Dim data As DataTable
    Dim da As MySqlDataAdapter
    Dim cb As MySqlCommandBuilder
Now we start!
But really, lets start... (It says "Friday!!!!!!!!! Burn the shrimp, burn it)

Add 5 Textboxes & 1 Buten!

Textbox1 : Server URL; URL to connect to the server
Textbox2 : Database Name: Name of the Database
Textbox3 : Database Table: (Just to be more precise, cause I don't like selectin my tables!)
Textbox4 : Database Username: Username used to connect.
Textbox5 : Database Password: Password used to connect.
Button1 : Button that will handle the connection.

If you want, you can make textbox5 have a password char of "•"

Under Button1:

Code:
'Disable Buttens!
TextBox1.Enabled = False
        TextBox2.Enabled = False
        TextBox3.Enabled = False
        TextBox4.Enabled = False
        TextBox5.Enabled = False
        Button1.Enabled = False
        If Not conn Is Nothing Then conn.Close()
        'Server Info
        Dim connStr As String
        connStr = String.Format("server=" & TextBox1.Text & ";user id=" & TextBox4.Text & "; password=" & TextBox5.Text & "; database=" & TextBox2.Text & "; pooling=false", TextBox1.Text, TextBox4.Text, TextBox5.Text)

        Try
            conn = New MySqlConnection(connStr)
            conn.Open()
            'Connection Success
            ShowTbl()
        Catch ex As MySqlException
            'Connection Failed, redo.
            MessageBox.Show("Error connecting to the server: " + ex.Message)
            TextBox1.Enabled = True
            TextBox2.Enabled = True
            TextBox3.Enabled = True
            TextBox4.Enabled = True
            TextBox5.Enabled = True
            Button1.Enabled = True
        End Try
So lets make a new function for ShowTbl()!

Code:
Public Sub ShowTbl()

End Sub
Add a DataGridView called DataGridView1 -.-

Add a butten that will save the database called button2


Yay! or not...


So teh Code under it (Sub ShowTbl()):
Code:
data = New DataTable
        da = New MySqlDataAdapter("SELECT * FROM " + TextBox3.Text, conn)
        cb = New MySqlCommandBuilder(da)
        da.Fill(data)
        DataGridView1.DataSource = data
        data.AcceptChanges()
        TextBox6.Enabled = True
        Button2.Enabled = True
    End Sub
Now For the Final Code! (Butten2):
Code:
Try
            Dim changes As DataTable = data.GetChanges()
            da.Update(changes)
            data.AcceptChanges()
        Catch ex As Exception
            MsgBox(ex.ToString)
        End Try
You will most likely get an error after trying to edit your database, ignore it and reclick the button untill it goes away.

DO NOT DELETE ROWS IT WILL NOT WORK!

Another tutorial will be added about removing rows sometime 2moro.

Tank Joo!
http://www.virustotal.com/file-scan/...7f4-1295505098
http://vscan.novirusthanks.org/file/...2LTMtNi16aXA=/
#1 · edited 15y ago · 15y ago
Lolland
Lolland
Virus scan.
#2 · 15y ago
mnpeepno2
mnpeepno2
VirusTotal - Free Online Virus, Malware and URL Scanner
http://vscan.novirusthanks.org/file/...2LTMtNi16aXA=/
done.
#3 · edited 15y ago · 15y ago
Jason
Jason
TL;DR just yet, I'll go through it properly tonight. Looks good from what I did read though.
#4 · 15y ago
Hassan
Hassan
Good Job Son.
#5 · 15y ago
mnpeepno2
mnpeepno2
Quote Originally Posted by Hassan View Post
Good Job Son.
Thanks Daddy!


Quote Originally Posted by Jason View Post
TL;DR just yet, I'll go through it properly tonight. Looks good from what I did read though.
uhh, ok.
#6 · 15y ago
Jason
Jason
Okay, most of it seems pretty good! Of course there are ways that it could be improved slightly, but that's the case with 90% of code.

Oh yeah

Code:
Imports System
Imports System.Data
Imports System.Windows.Forms


All of these namespaces are imported by default, so no need to manually type them out.
#7 · 15y ago
NextGen1
NextGen1
Moved to Tutorials section. Should be here. Visual Basic section is not for tutorials, it is for Closed application releases and questions.

Open Source Applications goto Open source, Snippets to snippets vault, tuts to tutorial section and tut requests to tut request section.

There is a reason for the sub sections, use them please & thank you.
#8 · 15y ago
mnpeepno2
mnpeepno2
Quote Originally Posted by Jason View Post
Okay, most of it seems pretty good! Of course there are ways that it could be improved slightly, but that's the case with 90% of code.

Oh yeah

Code:
Imports System
Imports System.Data
Imports System.Windows.Forms


All of these namespaces are imported by default, so no need to manually type them out.
Just felt like adding them to the imports list.
#9 · 15y ago
Posts 1–9 of 9 · Page 1 of 1

Post a Reply

Tags for this Thread

None