ファイルは対応するパスにアップロードされていますが、テーブル (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();
}