文件正在上传到对应的路径,但是表(fileinfo)没有更新..文件上传到服务器后如何实现表更新
protected void UploadComplete(Object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e)
{
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();
}