public bool addProjectComponent(BugModel bug) { bool flag = false; try { String sql = "INSERT INTO `tbl_component`( `component_name`, `component_desc`, `project_id`, `developerusername`) VALUES (@component_name,@component_desc,@project_id,@developerusername)"; MySqlConnection conn = DBUtils.GetDBConnection(); conn.Open(); MySqlCommand cmd = new MySqlCommand(); Debug.WriteLine("addprojectcomponent Called"); cmd.Connection = conn; cmd.Parameters.AddWithValue("@component_name", bug.getComponentName()); cmd.Parameters.AddWithValue("@component_desc", bug.getcomponentdesc()); cmd.Parameters.AddWithValue("@project_id", bug.getprojectid()); cmd.Parameters.AddWithValue("@developerusername", bug.getUsername()); cmd.CommandText = sql; int rowCount = cmd.ExecuteNonQuery(); if (rowCount > 0) { flag = true; } else { flag = false; } } catch (Exception e) { Debug.WriteLine("Error Message: " + e); Debug.WriteLine(e.StackTrace); } return(flag); }