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....

Well, assuming the title of your thread is the problem, I'd ask what a.FileName is and contains. An empty string is indeed not a legal file path, so you want to make sure that a.FileName represents a valid file that exists.

Most likely there's a flaw in the UI's design that allows the posted code to run before the filename was properly set and sanitized.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.