public static bool AddWallet(Wallet wallet) { bool retVal = false; SqlConnection connection = new SqlConnection(DBUtils.GetConnectionString()); string query = "INSERT Wallet" + "(address, userID, amount)" + "VALUES (@address, @userID, @amount)"; SqlCommand command = new SqlCommand(query, connection); command.Parameters.AddWithValue("@address", wallet.address); command.Parameters.AddWithValue("@userID", wallet.userID); command.Parameters.AddWithValue("@amount", wallet.amount); try { connection.Open(); int count = command.ExecuteNonQuery(); if (count > 0) { retVal = true; } else { retVal = false; } } catch (SqlException e) { Console.Write(e); } finally { connection.Close(); } return(retVal); }