i have an image along with a form, to be saved in the sql database. but how should i do it. here is the code that i used to save the form in the database.
Protected Sub save_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles save.Click
Dim ConnStr As String
Dim visitors_name, officer_to_visit, purpose, date_of_visit, time_in, time_out As String
Dim serial_no, year, floor As String
Dim photo As Byte
ConnStr = ConfigurationManager.ConnectionStrings("gate").ConnectionString()
Dim conn As New SqlConnection(ConnStr)
Dim dt As Date
dt = Date.Today
conn.Open()
serial_no = serialno.Text
years.Text = DateTime.Now.Year
visitors_name = visitorsname.Text
officer_to_visit = officertovisit.Text
purpose = pur.Text
date_of_visit = dateofvisit.Text
floor = wing.Text
time_in = inout.Text
time_out = timeout.Text
Dim insert As New SqlClient.SqlCommand("insert into visitors_pass (serial_no,year ,visitors_name ,officer_to_visit,purpose,date_of_visit,floor,time_in,time_out,photo) Values('" & serial_no & "' ,'" & dt.Year.ToString & "', '" & visitors_name & "','" & officer_to_visit & "','" & purpose & "',CONVERT(datetime ,'" & date_of_visit & "', 103),'" & floor & "','" & time_in & "','" & time_out & "','" & photo & "')", conn)
insert.ExecuteNonQuery()
conn.Close()
MsgBox("record saved")
End Sub
is it enough to add the coding to this code or need to do some alterations........please help me...............
thank you.