How to Update Database Table after AjaxFileUpload ASP.NET

rast

New Member
The file is uploading to the corresponding path but table (fileinfo) is not updating..How to achieve the table updation after a file is being uploaded to the server\[code\] string str = RadioButton1.Text; string path = Server.MapPath("~/" + str +"/") + e.FileName; AjaxFileUpload1.SaveAs(path); SqlConnection con = new SqlConnection("Data Source=localhost\\sqlexpress; Initial Catalog=example;user ID=sa;password=*******;"); con.Open(); string command1 = "insert into fileinfo(fileid,filename,date1) values(@fileid,@filename,@date1)"; SqlCommand command = new SqlCommand(command1, con); command.Parameters.AddWithValue("@fileid", "101"); command.Parameters.AddWithValue("@filename", e.FileName); command.Parameters.AddWithValue("@date1", DateTime.Now); command.ExecuteNonQuery();\[/code\]
 
Back
Top