public void alreadyExists() // function to check the existing records { DateTime tdy = DateTime.Now; DateTime aft2dy = DateTime.Now.AddDays(2); string str="select due_date from mConfirm where due_date BETWEEN '"+tdy+"' AND '"+aft2dy+"'"; sda = new SqlDataAdapter(str, cn); ds1 = new DataSet(); sda.Fill(ds1); // HERE I M GETTING THE EXCEPTION.... AS //"public void alreadyExists() // function to check the existing records" string d = ds1.Tables[0].Rows[0].ItemArray[0].ToString(); if ((Convert.ToDateTime(d) - DateTime.Today).TotalDays <= 2) // HERE WHAT SHOULD I DO { LblAlreadyExists.Text = "Already Under Process"; } }
string str="select due_date from mConfirm where due_date BETWEEN '"+tdy.ToShortDateString()+"' AND '"+aft2dy.ToShortDateString()+"'";
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)