Hi all plz help me by the following error.
I try to insert in row in sql data base.
My code is like this......
try
{
con.Open();
cmd.Connection = con;
cmd.Parameters.AddWithValue("@tempStudentName", studentName);
cmd.Parameters.AddWithValue("@tempFatherName", fatherName);
cmd.Parameters.AddWithValue("@tempDOB", DOB);
int rowCount = Convert.ToInt32(cmd.ExecuteScalar()); //Here i getting error and from here it jump to Exception.
cmd.Parameters.Clear();
if (rowCount > 0)
{.............}
else
{................}
catch (Exception) // it come here and show error The conversion of a nvarchar data type to a datetime data type resulted in an out-of-range value.
{
trans.Rollback(); // here error is NullReferenceException was unhandled by user code & Object reference not set to ...
Go to the complete details ...