hi all, I am having a problem with importing images into Database with code.
I've done this so far
Dim conn As New Data.SqlClient.SqlConnection("Data Source=virtualmachinelink,1433;Network Library=DBMSSOCN;Initial Catalog=School Management;User ID=me;Password=mypass") 'dont worry about the connection string, is good, Dim SDA As New SqlDataAdapter Dim bSource As New BindingSource Try conn.Open() Dim Query As String Query = "INSERT INTO Studenti (ID, Emri, Mbiemri, Gjinia, Datelindja, Shkolla, Klasa, Viti, Qarku, Email, Cel, ProfilePic, IDPic) values ('" & FlatTextBox1.Text & "','" & FlatTextBox2.Text & "','" & FlatTextBox3.Text & "','" & FlatTextBox4.Text & "','" & FlatTextBox5.Text & "','" & FlatTextBox6.Text & "','" & FlatTextBox7.Text & "','" & FlatTextBox8.Text & "','" & FlatTextBox9.Text & "','" & FlatTextBox10.Text & "','" & FlatTextBox11.Text & "','" & TextProfilePic.Text & "','" & TextIDPic.Text & "')" Command = New SqlCommand(Query, conn) SDA.SelectCommand = Command SDA.Fill(dbDataSet) bSource.DataSource = dbDataSet conn.Close() Catch ex As SqlException MsgBox(ex.Message) Finally conn.Dispose() End Try
I've created 2 columns. 1- ProfilePic, 2-IDcardPic
both set as 'Image' (could not find blob)
I am having problem with importing those two in.
PS: FlatTextbox is just normal textbox. but is called like that from a design UI I am using.
Edited 9 Months Ago by altjen