By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,987 Members | 1,552 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,987 IT Pros & Developers. It's quick & easy.

empty path name is not legal

P: 1
Expand|Select|Wrap|Line Numbers
  1.  Try
  2.             Dim cn As New SqlConnection("Data Source=MSR\LOCAL;Initial Catalog=Eventena;Integrated Security=True")
  3.             cn.Open()
  4.             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)
  5.                 cmd.Parameters.Add(New SqlClient.SqlParameter("@BirthdayVP", SqlDbType.Image)).Value = IO.File.ReadAllBytes(a.FileName)
  6.                 i = cmd.ExecuteNonQuery
  7.             End Using
  8.             If (i > 0) Then
  9.                 MsgBox("Inserted" & i & "record successfully", MsgBoxStyle.Information)
  10.                 BirthdayPaymentMode.Show()
  11.                 clear()
  12.             End If
  13.         Catch ex As Exception
  14.             MessageBox.Show(ex.Message)
  15.         End Try
  16.         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.
Oct 21 '16 #1
Share this Question
Share on Google+
1 Reply


Frinavale
Expert Mod 5K+
P: 9,731
What is the variable a?
It is not declared in the above posted code.
Oct 26 '16 #2

Post your reply

Sign in to post your reply or Sign up for a free account.