Click here to Skip to main content
16,021,288 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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:
C#
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.
Posted
Updated 11-Sep-10 4:25am
v2
Comments
Sandeep Mewara 11-Sep-10 10:26am    
Using PRE tags to format code part makes your question readable. Do use it next time.

1 solution

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>
 
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