binding and exporting a database with my application in Visual Basic Express so that I can read write?
Question by Brian D: binding and exporting a database with my application in Visual Basic Express so that I can read write?
What I am trying to do is be able to move things around (picture files), on a Form that I made in VB and furthermore associate file strings to them. I will have an opendialogbox with them as the user has to click on them and selects a file that is then assigned to the picture file. Also the user is able to dynamically create and drag the pictures around the form and leave it wherever they want to. The problem I am having, and thinking that I might need a database because after the file is closed, it is opened again, I want to have the points (locations on the form), for the specific pictures as well as the file associated with them loaded up so that everything looks as it did before they closed it. Now I am wondering if I need a whole elaborate database for that. In the end this application has to be able to be transported to their machine and executed. Thus this means that the database has to go with it. Any ideas? Sample code? Will an XML file work better?
This is the general idea for the input into the MSSQL. Let me know if this is all needed…
Public Sub Save(ByVal bwavfile() As Byte)
Dim DBInsertCmd As SqlClient.SqlCommand
Dim sSQL As String
Dim strConn As String
strConn = “”
DBInsertCmd = New SqlClient.SqlCommand
DBInsertCmd.Connection = New SqlClient.SqlConnection(strConn)
Dim strBase64WavFile As String = Convert.ToBase64String(bwavfile)
sSQL = “INSERT INTO wavfiles(filename, soundfile) values (@filename, ” &_
“@bwavfile)”
DBInsertCmd.CommandText = sSQL
With DBInsertCmd.Parameters
.Clear()
.Add(”@filename”, Me.TextBox2.Text)
.Add(”@bwavfile”, strBase64WavFile)
End With
DBInsertCmd.Connection.Open()
Try
DBInsertCmd.ExecuteNonQuery()
MessageBox.Show(”Wav File Saved”)
Catch oExcept As Exception
MessageBox.Show(oExcept.Message)
End Try
DBInsertCmd.Connection.Close()
DBInsertCmd = Nothing
End Sub
I am trying to understand the pieces more precicely and know more of what I really need and do not or even if I need this whole scheme. Perhaps if you have a simple working example about the saving of dynamic data creation to file, I would be very happy to see it.
Thanks much,
Brian
Best answer:
Answer by Jake Cigar
You’re not getting any good responses because no serious programmers use VB. Perhaps you should find a Microsoft forum.
Add your own answer in the comments!

















