For Jamie Holcom: i don’t know if there is a tutorial about how to do that, but it can be done, and yes, with a vb.net program or directly in your program – i have done one that . here’s some code
Dim conn1 = New MySqlConnection()
conn1.ConnectionString = “server=localhost;” & _
“user id=root;” & _
“password=” & ********
‘”;
‘Try
Dim myCommand As New MySqlCommand
Dim mySQLstr As String
Dim nume As String
Dim dialog As New OpenFileDialog
If dialog.ShowDialog = System.Windows.Forms.DialogResult.OK Then
nume = dialog.FileName.ToString
Dim fileContents As String
fileContents = My.Computer.FileSystem.ReadAllText(nume)
Try
mySQLstr = fileContents
conn1.Open()
myCommand.Connection = conn1
myCommand.CommandText = mySQLstr
myCommand.ExecuteNonQuery()
conn1.Close()
MsgBox(“Baza de date a fost creata!”)
Catch myerror As MySqlException
MsgBox(“Eroare: ” & myerror.Message)
Finally
If conn1.State ConnectionState.Closed Then conn1.Close()
End Try
End If
it will open a dialog to chose the sql file containing the structure
of course it can be automated.
ATTENTION: Do not specify the database in the connection string.
Topic: Information
———
https://www.dreamincode.net/forums/topic/149554-how-to-create-automated-backup-files-in-vbnet-application/
———
dim query as string="Select * from table"
dim da as new oledbdataadapter(query,con)
dim ds as new dataset
da.fill(ds,"Table")
me.dgv.datasource=ds
me.dgv.datamember="Table"
ds.dispose
con.close
———
https://www.dreamincode.net/forums/topic/92266-deployment-of-database-with-the-application-software/
———
https://www.math-cs.gordon.edu/courses/cs211/ATMExample/
———
https://www.connectionstrings.com/
https://www.vkinfotek.com/connectionstring.html
———
https://www.knowdotnet.com/articles/printgriddemo.html
———
https://www.codeproject.com/KB/books/vbdotnetkickstart.aspx
———
Private Function GenerateVBStringBuilderCode() As String
Dim s As String
Dim sb As New StringBuilder(5000)
'Append StringBuilder declaration
sb.Append("Dim sb As New System.Text.StringBuilder(5000)")
sb.Append(vbCrLf)
For Each s In Me.tbSource.Lines
'Append each line
sb.Append("sb.Append(""")
sb.Append(EscapeString(s))
sb.Append(""")")
sb.Append(vbCrLf)
If Me.cbPreserveCRLF.Checked Then
'Append a vbCrLf if new lines are to be preserved
sb.Append("sb.Append(vbCrLf)")
sb.Append(vbCrLf)
End If
Next
Return sb.ToString
End Function
Private Function GenerateCSharpStringBuilderCode() As String
Dim s As String
Dim sb As New StringBuilder(5000)
'Append StringBuilder declaration
sb.Append("System.Text.StringBuilder sb = new System.Text.StringBuilder(5000);")
sb.Append(vbCrLf)
For Each s In Me.tbSource.Lines
'Append each line
sb.Append("sb.Append(@""")
sb.Append(EscapeString(s))
sb.Append(""");")
sb.Append(vbCrLf)
If Me.cbPreserveCRLF.Checked Then
'Append a vbCrLf if new lines are to be preserved
sb.Append("sb.Append(Environment.NewLine);")
sb.Append(vbCrLf)
End If
Next
Return sb.ToString
End Function
Private Sub CopyToClipboard()
'Put the generated code on the clipboard
Try
Clipboard.SetDataObject(Me.tbResult.Text)
Catch
MessageBox.Show("The code could not be copied to the clipboard.", "Error Copying to Clipboard", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1)
End Try
End Sub
Private Function EscapeString(ByVal source As String) As String
'Escape(double) any quotes that appear in the text
If Not source Is Nothing Then
Return source.Replace("""", """""")
Else
Return String.Empty
End If
End Function
Private Sub btnGenerate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGenerate.Click
If Me.rbVB.Checked Then
Me.tbResult.Text = Me.GenerateVBStringBuilderCode
Else
Me.tbResult.Text = Me.GenerateCSharpStringBuilderCode
End If
End Sub
Private Sub btnCopy_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCopy.Click
Me.CopyToClipboard()
End Sub
———
https://www.knowdotnet.com/windowsforms.html