Click here to Skip to main content
15,886,518 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Error Cannot perform '=' operation on System.Decimal and System.String

Initially i'm assigning
C#
RadNode.Value = ds.Tables[0].Rows[i]["ModuleID"].ToString();


im copying Dataset table to Datatable
dt = ds.Tables[1];

Error occuring in the following line
C#
DataRow[] dtrw = dt.Select("ModuleID='RadNode.Value'"); 
Posted
Updated 9-Dec-15 21:02pm
v4

Try this
C#
DataRow[] dtrw = dt.Select("ModuleID='" + RadNode.Value + "'"); 

The value needs to be passed in, not the variable.
 
Share this answer
 
v2
I am not an expert, but, according to this page: "DataView RowFilter Syntax [C#]"[^] you have to drop the single quotes, try:
C#
DataRow[] dtrw = dt.Select(String.Format("ModuleID={0}", RadNode.Value); 
 
Share this answer
 

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