比较两列 [英] Comparing two columns

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

问题描述

大家好,

我是C#的新手.我想比较datagridview中的2列.如果一个成员具有两种策略类型,则警报消息需要显示为单个成员ic的两种策略类型".
我的代码如下:

Hi all,

I am new to C#. I want to compare 2 columns in datagridview. If one member having two polacytypes then alert message needs to appear as "two policy types for single member ic".
My code is as below:

string str="select * from polacyalert where memberic='" + mcno + "'";          
SqlDataAdapter da =new SqlDataAdapter(str,con);
DataSet ds = new DataSet();
da.Fill(ds, "polacyalert");
BindingSource bsource = new BindingSource();
bsource.DataSource = ds.Tables["polacyalert"];
dgv.DataSource = bsource.DataSource;




请帮助我.

谢谢&问候,
乌玛.




Please help me on this.

Thanks & Regards,
Uma.

推荐答案

HI

int Polacycount =从polacyalert中选择count(Polacytypes),其中memberic =''"+ mcno +"'';

HI

int Polacycount = select count(Polacytypes) from polacyalert where memberic=''" + mcno + "''";

if(Polacycount > 1)
{
 // Alert message two policy types for single member ic
}<br>
</br>


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

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