Hi,
In C# if you are gonig to use the == operator its not defined for type string and boll(ie string == bool)but since you are trying to check it the string 'loginus' is not empty you can use one of this options
1. if(loginus != "")
2. if(loginus != string.Empty)
3. if(!string.IsNullOrEmpty())
4. if(string.IsNullOrEmpty() == false)
5. if(string.Count != 0)
All this are valids if statements pick the one you like better.
Regards,
Camilo
camilojvarona
Junior Poster in Training
89 posts since Jul 2008
Reputation Points: 10
Solved Threads: 10
Yes
The code whe you are populating the LisBox is the Constructor and only executes whe you crate a new objec(when you use the 'new' keyword) and at this point the 'logingus' is empty so it would not 'enter' the 'if'. A solution is to change that code to the button1Click method.
Camilo
camilojvarona
Junior Poster in Training
89 posts since Jul 2008
Reputation Points: 10
Solved Threads: 10