Hi friends i need a help with if statement iam try to do if record is exist then display the msg but getting the error .The type or namespace name 'Exist' could not be found (are you missing a using directive or an assembly reference?)
my code is like this
and the probelm is here
my code is like this
Code:
private void cmdAdd_Click(object sender, System.EventArgs e) { SqlConnection oConn=new SqlConnection(System.Configuration.ConfigurationSettings.AppSettings["oConn"]); SqlDataAdapter da=new SqlDataAdapter("usp_insertproject", oConn); da.SelectCommand.CommandType=CommandType.StoredProcedure; da.SelectCommand.Parameters.Add(new SqlParameter("@ProjectName",txtprojectname.Text)); da.SelectCommand.Parameters.Add(new SqlParameter("@ProjectDesc",txtDescription.Text)); SqlParameter projectid = new SqlParameter("@projectID",SqlDbType.Int); projectid.Direction = ParameterDirection.Output; da.SelectCommand.Parameters.Add(projectid); oConn.Open(); da.SelectCommand.ExecuteNonQuery(); oConn.Close(); if(Exist) { Response.Write("Record is already exist"); } } } }
Code:
if(Exist) { Response.Write("Record is already exist"); } please help me
Comment