hi guys! Can you help me figure out what's wrong with my code below. Thanks in advance!
Code:public int DAA_AddUserAccount(string user_Name, string user_Password, string user_Firsname, string user_Lastname, string user_MiddleInitial) { try { int returnval = 0; spName = "sp_User_AddUserAccount"; DBConnection.DBConnection dbConnection = new DBConnection.DBConnection(); connection = dbConnection.CreateConnection(); connection.Open(); command = new SqlCommand(); command.CommandText = spName; command.CommandType = CommandType.StoredProcedure; command.Parameters.AddWithValue("@User_LogIn", user_Name); command.Parameters.AddWithValue("@User_PassWord", user_Password); command.Parameters.AddWithValue("@User_FirstName", user_Firsname); command.Parameters.AddWithValue("@User_LastName", user_Lastname); command.Parameters.AddWithValue("@User_MiddleInitial", user_MiddleInitial); //SqlParameter parameter = command.Parameters.Add("@identity", SqlDbType.Int); //parameter.Direction = ParameterDirection.Output; command.Connection = connection; returnval = command.ExecuteNonQuery(); return returnval; } catch (SqlException ex) { CommonFunctions.ShowSqlException(ex); } finally { connection.Close(); } }
Error 1 'RCPSProject.DAA_Classes.DAA_UserAccount.DAA_AddUserAccount(string, string, string, string, string)': not all code paths return a val




Reply With Quote