Dim connection As New SqlConnection(ConfigurationManager.ConnectionStrings("connect").ConnectionString.ToString()) <pre lang="vb">If FileUpload1.HasFile AndAlso FileUpload1.PostedFile IsNot Nothing Then Dim File As HttpPostedFile = FileUpload1.PostedFile imgByte = New [Byte](File.ContentLength) {} File.InputStream.Read(imgByte, 0, File.ContentLength) End If connection.Open() Dim cmd As New SqlCommand() cmd.CommandType = CommandType.Text cmd.CommandText = (insert into Emp1(EmpName,EMpAdd,imPhoto)values('" & TextBox1.Text & "','" & TextBox2.Text & "','" & imgByte & "' )",connection) cmd.Connection = connection Dim id As Integer = Convert.ToInt32(cmd.ExecuteScalar())</pre>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)