I have a fileupload option in my project. It inclueds a query which returns a dataset. It works fine. But now i want to check whether the returning dataset is is empty or the same value i passed as a parameter to the query. Here is my back end code.
.cs code
if ((FileUpload1.HasFile))//&& (ext == ".pdf")
{
ds = db.checkExistingPDF(fileName);
if (dbFileName != fileName)
{
this.FileUpload1.SaveAs(Path.Combine(svrPath, fileName + ".pdf"));
ScriptManager.RegisterStartupScript(this, this.GetType(), "Message", " alert('Successfully uploaded');", true);
}
else
{
ScriptManager.RegisterStartupScript(this, this.GetType(), "Message", " confirm ('Appeal is availbale for the this competition') ; ", true);
}
else
{
ScriptManager.RegisterStartupScript(this, this.GetType(), "Message", " confirm ('Error') ; ", true);
}
Here is my query
public DataSet checkExistingPDF(string fileName)
{
string strQuery = @"IF EXISTS (SELECT * FROM APPEAL_MASTER WHERE Attachment_upload = '"+ fileName +"')";
return SqlHelper.ExecuteDataset(strConnStringAppeal, CommandType.Text, strQuery);
}
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)