UKuser
unread,Nov 15, 2009, 3:39:19 PM11/15/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
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