Discord Server Twitter Donation Youtube Google+
Thread Rating:
  • 1 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
mybb_mysql_browser
#1
here is my mybb_mysql_query browser
code:

whats needed
1 textbox
1 gridview
1 button



Imports MySql.Data.MySqlClient
Imports System
Imports System.Security.Cryptography
Imports System.Text

Public Class Form1

    Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
        Dim g As Graphics = e.Graphics
        Dim pen As New Pen(Color.Red, 4.0)

        Dim txtBox As Control
        For Each txtBox In Me.Controls
            If TypeOf (txtBox) Is TextBox Then
                g.DrawRectangle(pen, New Rectangle(txtBox.Location, _
                txtBox.Size))
            End If
        Next
        pen.Dispose()


      


    End Sub



    'Represents an SQL statement or stored procedure to execute against a data source.
    Dim cmd As New MySqlCommand
    Dim da As New MySqlDataAdapter
    Public total As Integer
    Dim publictable As New DataTable
    'declare conn as connection and it will now a new connection because 
    'it is equal to Getconnection Function
    Dim con As MySqlConnection = jokenconn()

    Public Function jokenconn() As MySqlConnection
        Return New MySqlConnection("server=server_ipaddress;user id=usernamehere; password=your-password-here;database=dbname")
    End Function
   
    


   
    
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
     

        Dim publictable As New DataTable
        Dim sql As String
        sql = TextBox1.Text
        Try
            'bind the connection and query
            With cmd
                .Connection = con
                .CommandText = sql
            End With
            'Gets or sets a Transact-SQL statement or stored procedure used to select records in the data source.
            da.SelectCommand = cmd
            da.Fill(publictable)
            'get the datasource from publictable and passed to datagridview
            DataGridView1.DataSource = publictable

            'dispose the dataadapter
            da.Dispose()
        Catch ex As Exception

            MsgBox(ex.Message)

        End Try
        con.Close()
        da.Dispose()

    End Sub
    Public Overrides Property AutoSize As Boolean
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        TextBox1.BorderStyle = BorderStyle.None
        DataGridView1.BorderStyle = BorderStyle.None
        TextBox1.Text = "select * from mybb_users"
        Button1.PerformClick()
        Me.WindowState = FormWindowState.Maximized
        DataGridView1.GridColor = Color.BlueViolet
        TextBox1.AutoSize = True
    End Sub


End Class

sql browser images:

[Image: querrybrowser.png]

[Image: querytables.png]
Reply
#2
It is very nice app, Thank you for making that.
Could you add a help doc for the app and add some SQL command so we can use it easier.

[Image: 4Kxb0N1.gif]
We Are Anonymous, We Are Legion, We Do not Forgive, We do not Forget
Expect Us
Reply
#3
Bro i need VB.NET cause i move state so i got nothing now forgot put it in my USP.
You can answer here or skype.
[Image: Mh9wqWO.png]
Reply
#4
mybb_mysql_browser Update

Add to  existing form1_load keep in mind this has been tested but look like crap so by all means change the color and experiment with itt
code change the ground color and text colo of a datagrid

  DataGridView1.RowsDefaultCellStyle.BackColor = Color.Bisque
  DataGridView1.GridColor = Color.Red 
  DataGridView1.CellBorderStyle = DataGridViewCellBorderStyle.None
  DataGridView1.BackgroundColor = Color.LightGray
  DataGridView1.DefaultCellStyle.SelectionBackColor = Color.Red
  DataGridView1.DefaultCellStyle.SelectionForeColor = Color.Yellow
  DataGridView1.DefaultCellStyle.WrapMode = DataGridViewTriState  .[True]
  DataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect
  DataGridView1.AllowUserToResizeColumns = False
  DataGridView1.RowsDefaultCellStyle.BackColor = Color.Bisque
  DataGridView1.AlternatingRowsDefaultCellStyle.BackColor = Color.Beige
Reply
#5
(07-28-2017, 04:05 AM)viruss Wrote: mybb_mysql_browser Update

Add to  existing form1_load keep in mind this has been tested but look like crap so by all means change the color and experiment with itt
code change the ground color and text colo of a datagrid

  DataGridView1.RowsDefaultCellStyle.BackColor = Color.Bisque
  DataGridView1.GridColor = Color.Red 
  DataGridView1.CellBorderStyle = DataGridViewCellBorderStyle.None
  DataGridView1.BackgroundColor = Color.LightGray
  DataGridView1.DefaultCellStyle.SelectionBackColor = Color.Red
  DataGridView1.DefaultCellStyle.SelectionForeColor = Color.Yellow
  DataGridView1.DefaultCellStyle.WrapMode = DataGridViewTriState  .[True]
  DataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect
  DataGridView1.AllowUserToResizeColumns = False
  DataGridView1.RowsDefaultCellStyle.BackColor = Color.Bisque
  DataGridView1.AlternatingRowsDefaultCellStyle.BackColor = Color.Beige


Nice work bro Smile

[Image: 4Kxb0N1.gif]
We Are Anonymous, We Are Legion, We Do not Forgive, We do not Forget
Expect Us
Reply




Users browsing this thread: 2 Guest(s)