Hello:
I have the following statement and I am getting an error. I probably have the wrong syntax. Can someone tell me what I did wrong?
if (dataGridViewIP_Login.Rows[i].Cells["ColumnPassword"].Value == textBoxUser_ID.Text)
Compare grid value to a text
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Kirtan PatelRank #292 · 8.6K reputationPosted Feb 27, 2010, 7:31 PM EST
you need to convert value to String then you can compare it with other string
if (dataGridViewIP_Login.Rows[i].Cells["ColumnPassword"].Value.ToString() == textBoxUser_ID.Text)
Now it will work !! :)
GustavoRank #1,990 · 732 reputationPosted Feb 27, 2010, 7:46 PM EST
It worked... Thanks... I really appreciate it.