Hi Folks,
As a PHP developer, I've been playing with C# and am wondering why
this code produces an error:
protected void Page_Load(object sender, EventArgs e)
{
string test = this.outputTest();
OdbcConnection myConn = mySqlConnect("localhost", "test",
"test", "licensi_lwsite");
DataTable myData = SelectData("Select * FROM information",
myConn);
Dictionary<object, object> mylist = new Dictionary<object,
object>();
for (int i=0;i<myData.Rows.Count;i++)
{
mylist.Add = myData.Rows[i].ToString();
}
}
I get the following error:
Cannot assign to 'Add' because it is a 'method group'
I'm basically trying to create my own dictionary which is something
I've done in PHP very easily, but is proving more of a challenge in
C#.
Also can you end up in this situation:
Dictionary<object,objectX>
where objectX is another dictionary, or it could be a string or
integer? In PHP arrays can contain any values including arrays
(dictionarys), but I'm interested to see how flexible C# is?
Thanks
A