Hi,
I want to get the size, of the selected Database in bytes. Could you help me out with some vb code.
Thanks,
Barnabás
Get Database size
-
- Posts: 729
- Joined: Thu 13 Dec 2007 10:24
Here's the code.
Hope you will easily get the idea.
Hope you will easily get the idea.
Code: Select all
Imports CoreLab.Data
Imports CoreLab.MySql
Module Module1
Sub Main()
Dim mySelectQuery As String
mySelectQuery = "show table status"
Dim myConnection As New MySqlConnection("user id=root;password=root;host=localhost;database=test;")
Dim myCommand As New MySqlCommand(mySelectQuery, myConnection)
Dim totalSpace As Int32
totalSpace = 0
myConnection.Open()
Dim myReader As MySqlDataReader
myReader = myCommand.ExecuteReader()
While (myReader.Read())
Console.WriteLine(myReader.GetInt32(6) & "," & myReader.GetInt32(6))
totalSpace += myReader.GetInt32(6) + myReader.GetInt32(6)
End While
myReader.Close()
myConnection.Close()
Console.WriteLine(totalSpace)
Console.Read()
End Sub
End Module
-
- Posts: 729
- Joined: Thu 13 Dec 2007 10:24