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()
this is the error im facing..
im taking the data from one table nd displaying in the datagrid nd using dat im displaying in a label and in picture box and dat has to store in anther table.. so i dont knw how to face this problm. please help me in the issue....