Im having problems diming a variable in vb .net, I know how to do it in Vb but .net its giving me and error saying that 'statment is not valid in a namespace' with this code 'Dim I As String'. Whats goin on with that, its works in vb but not .net?
__________________
When traveling down the road of life, Try not to drag your face in the gravel.
Well that was it...I was just toying around with a password box in my free time, the code works in Vb but not .net. I guess Ill post my Vb code..
Code:
Dim PassWord As String
Private Sub cmdEnter_Click()
If txtPassword.Text = PassWord Then
MsgBox ("Correct")
Else
MsgBox ("Wrong")
End If
End Sub
Private Sub Form_Load()
PassWord = "woot"
End Sub
This same code doesnt work in .net and its giving me the 'statment is not valid in a namespace' error when I dim Password as string and was wondering why
__________________
When traveling down the road of life, Try not to drag your face in the gravel.
You Dim variables in general declarations am I not right, thats the way it was in Vb.
You can declare variables almost anywhere. Write your program in vb6, then open it in .NET and it will convert it over for you. I run your same code in .NET and it works fine. Surely it's something simple.
Hey if it was free I figured why not take advantage of it lol, free things from microsoft come once in a blue moon esp. when its one of their key money making products apart from their Os. We learn on Vb6 at school though, I need somebooks or sites so I can teach myself more at home because for our final this semseter We gotta come up with our own program and make it and ive got almost no clue what im going to do.
__________________
When traveling down the road of life, Try not to drag your face in the gravel.