错误无法在System.Decimal和System.String上执行'='操作 [英] Error Cannot perform '=' operation on System.Decimal and System.String

查看:266
本文介绍了错误无法在System.Decimal和System.String上执行'='操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

错误无法在System.Decimal和System.String上执行``=''操作

最初,我分配

Error Cannot perform ''='' operation on System.Decimal and System.String

Initially i''m assigning

RadNode.Value = ds.Tables[0].Rows[i]["ModuleID"].ToString();



即时通讯将数据集表复制到数据表
dt = ds.Tables [1];

下一行出现错误



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

Error occuring in the following line

DataRow[] dtrw = dt.Select("ModuleID='RadNode.Value'"); 

推荐答案

尝试一下
DataRow[] dtrw = dt.Select("ModuleID='" + RadNode.Value + "'"); 


需要传递值,而不是变量.


The value needs to be passed in, not the variable.


我不是专家,但是,根据此页面: [ ^ ],您必须删除单引号,请尝试:
I am not an expert, but, according to this page: "DataView RowFilter Syntax [C#]"[^] you have to drop the single quotes, try:
DataRow[] dtrw = dt.Select(String.Format("ModuleID={0}", RadNode.Value); 


这篇关于错误无法在System.Decimal和System.String上执行'='操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆