Click here to Skip to main content
15,904,351 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
hi
when i write following command
C#
TreeNode myChild = new TreeNode(System.Convert.ToString(mydt.Rows[j]["family"].ToString().Trim));


this error be shown after compile
Error 1 Argument 1: cannot convert from 'method group' to 'string'


thanks
Posted
Updated 25-Jan-15 18:09pm
v2
Comments
SrikantSahu 25-Jan-15 16:18pm    
Hi,
Trim is a method , so it should be called by Trim().
TreeNode myChild = new TreeNode(System.Convert.ToString(mydt.Rows[j]["family"].ToString().Trim()));

Thx

1 solution

Trim() is a method[^] of String, not a property. You missed the ().
 
Share this answer
 
Comments
armm1388 26-Jan-15 6:19am    
thanks from all

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900