DaveAmour 160 Mmmmmm beer Featured Poster
DaveAmour 160 Mmmmmm beer Featured Poster

Hi Dani

Yep a profile piccy.

DaveAmour 160 Mmmmmm beer Featured Poster

I get an errror when trying to upload a profile photo.

The upload destination folder does not appear to be writable.

DaveAmour 160 Mmmmmm beer Featured Poster

Also where is the rest of your code and do your instructions give a definition for special characters?

DaveAmour 160 Mmmmmm beer Featured Poster

A class is needed - this is an academic piece of work and the instructions say to use a class. Always follow the instructions if you want good marks!

DaveAmour 160 Mmmmmm beer Featured Poster

Darkagn is right - line 6 certainly looks wrong

DaveAmour 160 Mmmmmm beer Featured Poster

What kind of panel?

DaveAmour 160 Mmmmmm beer Featured Poster

Yes its pretty much the same - just make sure you keep the service alive!

DaveAmour 160 Mmmmmm beer Featured Poster

Hi

Sorry for the late reply. Ok I just noticed you said this is a console application which means that when it gets to line 7 then it will just end.

You need to keep the app alive. Windows forms apps are kept alive for you but console apps will just die unless you tell them otherwise.

You can do this by putting a Console.Read() after line 5 or better still an endless loop. In a real app you would give a way of exiting the loop but for brevity this will do:

Imports System.Timers

Module Module1

    Sub Main()
        Dim aTimer As New System.Timers.Timer()
        AddHandler aTimer.Elapsed, AddressOf DoFunction
        aTimer.Interval = 2000
        aTimer.Enabled = True
        'aTimer.Start()

        While True

        End While
    End Sub

    Public Sub DoFunction(ByVal source As Object, ByVal e As ElapsedEventArgs)
        Console.WriteLine("Do Work")
    End Sub

End Module
DaveAmour 160 Mmmmmm beer Featured Poster

See what the sql statement actually is by debugging then run this manually in the database and see what you get.

There are some other good practice issues with your code but we can look at these after we have it functioning.

DaveAmour 160 Mmmmmm beer Featured Poster

Where is your other code - the code you want to run when the timer ticks?

DaveAmour 160 Mmmmmm beer Featured Poster

No probs

Any other issues give me a shout

DaveAmour 160 Mmmmmm beer Featured Poster

Ok I'm at work now - maybe you have time to get this in - I did this quickly in a few minutes so its not up to my usual standards - lacks error checking and commnents etc but maybe it will help in time?

using System;

class InchesToFeet
{
    static void Main()
    {
        //Declare variable
        int inches = 49;

        //output to the screen
        Console.WriteLine(inches.ToString() + " inches is ");
        
        TotalFeet(inches);

        TotalYards(inches);
        
        Console.ReadLine();
    }

    //Method to pass inches
    public static void TotalFeet(int inches)
    {
        //Calculation conversion for feet and inches
        int feet;

        int tInches;
        
        feet = inches / 12;

        tInches = inches % 12;
        
        Console.WriteLine("{0} feet and {1} inches", feet, tInches);
    }

    public static void TotalYards(int inches)
    {
        int feet;
        int tfeet;
        int yards;
        int tInches;

        feet = inches / 12;

        yards = feet / 3;

        tfeet = feet % 3;

        tInches = inches % 12;

        Console.WriteLine("{0} yard {1} feet and {2} inches", yards, tfeet, tInches);
    }
}
DaveAmour 160 Mmmmmm beer Featured Poster

Ahh sorry can't help then - literally just off to work in 1 minute. Very sorry.

DaveAmour 160 Mmmmmm beer Featured Poster

Ok leave it with me and I'll have a look later today. Is this quick enough or is this due today?

DaveAmour 160 Mmmmmm beer Featured Poster

Hi

Ok sorry for saying its a mess, just being honest!

Is there any flexibility in these instructions. I wouldn't want to put a Main method in the InchesToFeet class as then this class is difficult to reuse.

If there is no flexibility and you have to do exactly as told I will happily code this for you.

DaveAmour 160 Mmmmmm beer Featured Poster

Dude thats a mess!

Tell me in plain english what you want to achieve and I'll code it for you along with some explanation of good practice - eg classes should be named after nouns - eg Car, Person, Animal, Customer and the operations or methods should be named after verbs eg customer.Sell() or customer.Pay() and so on

Also your methods should not use Console as then they are tied to Console programs - you could not reuse your code in other apps - eg WinFroms or Webapps.

Better to have conversion methods return just the value and then output it to the Console from the main program or client code.

DaveAmour 160 Mmmmmm beer Featured Poster

I bet you can do this with linq in one line!