Lopytuplito
New Member
Hey<BR><BR>This seems to be a dummy-question. How can I get the Value of a db-field using c#? code like<BR><BR>OleDbConnection myConnection;<BR>OleDbCommand myCommand;<BR>OleDbDataReader myReader;<BR>...<BR>myConnection.Open();<BR>myReader = myCommand.ExecuteReader();<BR>if(myReader.Read())<BR>String myString = myReader("Name");<BR>...<BR><BR>gives me "'myReader' denotes a 'variable' where a 'method' was expected". <BR>Also myReader.Item("Name") doesn't work. I can do it using myReader.GetString(0), but I would prefer using the Field name rather than its Index.<BR><BR>I guess it's a rather basic c# thing, isn't it?<BR><BR>Thanx in advance.<BR>Martin<BR>www.loomgmbh.chyeah, simple. The little tricky "[" instead of "(" thing. Cheers