String Builder USage, [英] String Builder USage,

查看:88
本文介绍了String Builder USage,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



实际上我使用String Builder来过滤数据,我使用了字符串构建器使用了各种过滤器,最后我使用了这个:



dsDetails.Tables [CertificationDetails]。DefaultView.RowFilter = sbRowFilter.ToString();,



这给我的例外情况是:

无法对System.String和System.Int32执行'='操作。



请尽快帮助我





Hi
Actually i am using String Builder to Filter data, i have used various filters by using string builder, and at finally i used this:

dsDetails.Tables["CertificationDetails"].DefaultView.RowFilter = sbRowFilter.ToString();,

this is Giving Exception to me that :
Cannot perform '=' operation on System.String and System.Int32.

Please Help ME ASAP


if (DepartmentID > 0)
                     {
                         if (string.IsNullOrEmpty(sbRowFilter.ToString()))
                         {
                             sbRowFilter.Append("ISDepartmentMatch '=' 1");

                         }

                     }





此后我打电话:

dsDetails.Tables [CertificationDetails]。DefaultView.RowFilter = sbRowFilter.ToString();



After This i Called:
dsDetails.Tables["CertificationDetails"].DefaultView.RowFilter = sbRowFilter.ToString();

推荐答案

sbRowFilter.Append("ISDepartmentMatch= '1'");





该错误告诉您它无法将整数转换为字符串。在值周围放置单引号并删除等号周围的单引号。



The error is telling you that it can't convert an integer to string. Place single quotes around the value and remove the single quotes around the equal sign.


错误表示无法执行'='操作。您不应该使用单引号包装逻辑运算符=。从=运算符中删除引号,然后重试
The error says Cannot perform '=' operation. You should not wrap logical operator = with single quotes. Remove quotes from = operator and try again


这篇关于String Builder USage,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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