[Solved] Return Variable From Method


Just use the function itself to return the value. You do not need an additional output parameter.

private static int runupdates(string arr)
{
    updatestatement = "";
    using (SqlConnection connection = new SqlConnection(SQLConnectionString))
    {
        connection.Open();
        using (SqlCommand command = new SqlCommand(updatestatement, connection))
        {
        command.CommandText = updatestatement;
        int nummmm = command.ExecuteNonQuery();
        connection.Close();
        }
    }
    return nummmm;
}

2

solved Return Variable From Method