Code:
Try
Dim cn As New SqlConnection("Data Source=MSR\LOCAL;Initial Catalog=Eventena;Integrated Security=True")
cn.Open()
Using cmd As New SqlClient.SqlCommand("INSERT into BirthdayRegistration where Name='" & TextBox4.Text & "',LastName='" & TextBox2.Text & "',Email='" & TextBox5.Text & "',StreetNo='" & TextBox6.Text & "',Main='" & TextBox7.Text & "',Area='" & TextBox8.Text & "',City='" & ComboBox1.Text & "',State='" & ComboBox2.Text & "',BirthdayName='" & TextBox1.Text & "',BirthdayDate='" & DateTimePicker1.Text & "',Time='" & TextBox3.Text & "',Food='" & ComboBox3.Text & "',Guest='" & TextBox9.Text & "',Cost='" & Label19.Text & "',BirthdayVP=@BirthdayVP", cn)
cmd.Parameters.Add(New SqlClient.SqlParameter("@BirthdayVP", SqlDbType.Image)).Value = IO.File.ReadAllBytes(a.FileName)
i = cmd.ExecuteNonQuery
End Using
If (i > 0) Then
MsgBox("Inserted" & i & "record successfully", MsgBoxStyle.Information)
BirthdayPaymentMode.Show()
clear()
End If
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
cn.Close()
I'm displaying the image and the cost from 1st table in data grid.
I'm displaying in label data is cost and the image in picture box.
This image of picture box and the cost of label should have to store in 2nd table.. while doing this it shows empty path name is not legal.
Comment