Click here to Skip to main content
15,920,005 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I read two values from registry and keep them in two strings in a function.
These two values are stored in table in a database.
How do I compare the value stored in database and the values in two strings in a function.
Posted

1 solution

C#
con.Open();
        SqlDataAdapter adap = new SqlDataAdapter("Select column from your table_name", con);
        SqlCommandBuilder build = new SqlCommandBuilder(adap);
        DataTable dt = new DataTable();
        adap.Fill(dt);
        con.Close();

for(int i=0;i<dt.rows.count;i++)>
{
   if((dt.Row[i][0].Tostring()==string_VAlue1)&&(dt.Row[i][0].Tostring()==string_VAlue2)  )
   {
     //your block of code;
   }
}
 
Share this answer
 
v2

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