I am trying to convert a value to a string, as far as I can tell, I have to use the method toString, of the class Convert, of the namespace System.
Here's my code:
Compiler Error Message: CS0117: 'System.Convert' does not contain a definition for 'toString'
Source Error:
Line 101: while (r.Read())
Line 102: {
Line 103: listbox.Items.Add(new ListItem(Convert.toString(r["first_name"]), Convert.toString(r["first_name"])));
Line 104: }
What am I doing wrong exactly? I'm new to C# (hence why, if you look at my profile you see like 6-7 questions, all related to C# lately!). It's really making me practice my OOP chops too!
C# is case sensitive try this
Convert.ToString()
Get rid of the
Convert.toString(r["first_name"])
and change it to
r["first_name"].ToString()
Edited to rid the world of this nasty little typo :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With