ProgrammingN00b
New member
- Joined
- Dec 7, 2008
- Messages
- 4
- Programming Experience
- Beginner
I've succesfully (i think) managed to create a connection to my database.
I want to be able to transfer data from a textbox on the form into collumns of a table on the database. I've tried using this code but it doesn't seem to work, other than making a connection. What else am I missing?
thanks
I want to be able to transfer data from a textbox on the form into collumns of a table on the database. I've tried using this code but it doesn't seem to work, other than making a connection. What else am I missing?
VB.NET:
Try
myConnection = New SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename='C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\database.mdf';Integrated Security=True;Connect Timeout=30;User Instance=True")
myConnection.Open()
MsgBox("Connection Open ! ")
myCommand = New SqlCommand("INSERT INTO Customer VALUES 'xxx', 'yyyy'")
Catch ex As Exception
MessageBox.Show("Failed to connect to data source")
Finally
myConnection.Close()
End Try
thanks