高手们帮看看,谢了.下面是一断类文件中的上传文件示例,由于SQL语句没有执行,请问如何改才能打印出SQL语句,谢了.public void UpFile(string projectno, string path, HtmlInputFile file)
{
string strfullName = file.PostedFile.FileName;
string strFileName = strfullName.Substring(strfullName.LastIndexOf("\\") + 1);
if (strfullName != "")
{
DirectoryInfo dir= new DirectoryInfo(path);
string[] le = strFileName.Split(new char[]{'.'});
string name = le[le.Length-1];
name = strFileName;
path = path + "\\" + name;
file.PostedFile.SaveAs(path); string sql_upload= "insert into Plan_upload (ProjectNo,file,path,date)values ('"+projectno+"','"+strFileName+"','"+path+"','"+DateTime.Now.Date+"')"; this.TrySql(sql_upload,1);
}
}
{
string strfullName = file.PostedFile.FileName;
string strFileName = strfullName.Substring(strfullName.LastIndexOf("\\") + 1);
if (strfullName != "")
{
DirectoryInfo dir= new DirectoryInfo(path);
string[] le = strFileName.Split(new char[]{'.'});
string name = le[le.Length-1];
name = strFileName;
path = path + "\\" + name;
file.PostedFile.SaveAs(path); string sql_upload= "insert into Plan_upload (ProjectNo,file,path,date)values ('"+projectno+"','"+strFileName+"','"+path+"','"+DateTime.Now.Date+"')"; this.TrySql(sql_upload,1);
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货