Quantcast
Channel: VBForums - ASP, VB Script
Viewing all articles
Browse latest Browse all 686

May i ask how can i insert to access database.

$
0
0
I develop a program insert image to database below is my code can some one help me take a look

Save Function

Dim cmd As New OleDb.OleDbCommand
If Not cnn.State = ConnectionState.Open Then
cnn.Open()
End If

cmd.Connection = cnn

cmd.CommandText = "INSERT INTO Table1([Picture],[F1],[F2],[F3])" &
"VALUES('" & Me.PictureBox1.ImageLocation & "', '" & Me.TextBox1.Text & "','" & Me.TextBox2.Text & "','" & Me.TextBox3.Text & "')"

cmd.ExecuteNonQuery()
MessageBox.Show("Record Is Added")

i am fail insert picture to database, my datagridview
can someone teach me

Name:  1111.PNG
Views: 22
Size:  25.5 KBName:  12222.PNG
Views: 22
Size:  3.1 KB
Attached Images
  

Viewing all articles
Browse latest Browse all 686

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>