c# - Only assignment, call, increment, decrement, and new object expressions can be used as a statement and ; Expected -


public string messageitem (string itemname) {     { return dsmessagecontents.tables["input"].rows[0].tostring();} } 

i getting 2 errors:

  1. only assignment, call, increment, decrements, , new object expressions can used statement, ,
  2. expected ;

you're combining method , property that... won't work. :)

use method:

public string messageitem(string itemname) {     return dsmessagecontents.tables["input"].rows[0].tostring(); } 

or property:

public string messageitem {     { return dsmessagecontents.tables["input"].rows[0].tostring(); } } 

read on differences here.


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -