|
string filename="";
if(myFile.PostedFile.ContentLength>0)
{
string NM=myFile.PostedFile.FileName;
int i=NM.LastIndexOf(".");
string extNM=NM.Substring(i);
filename="QC"+mid+extNM;
UploadFile(filename);
}
else
{
filename=attachmentLb.Text;//這個
}
......
SqlParameter YeWuAttachment=new SqlParameter("@YeWuAttachment",SqlDbType.VarChar);
YeWuAttachment.Value=(filename==string.Empty?DBNull.Value:filename);
......
為什麼上面代碼會出錯,怎樣修正?謝謝大家!
錯誤:
CSSModify.cs(233,56): error CS0173: Type of conditional expression cannot be determined because there is no implicit conversion between 'System.DBNull' and 'string'
|
|