Saturday, January 4, 2014

how to read boolean value from gridview?

Hi,


I'm define a gridview control with code such as below:



sdt = new SqlDataAdapter("select Client_IP,[Like],Dislike from Dis_Like_Tbl where Client_IP =" + "'" + ip + "'", conn);
sdt.Fill(disLikedt);
disLikegr.DataSource = disLikedt;
disLikegr.DataBind();

but when I want read a boolean value from this gridview with below code, it don't work.



Boolean i = disLikegr.Rows[0].Cells[1].Text;
Boolean ii=disLikegr.Rows[0].Cells[2].Text;

I thank anyone who can advise me!




Good luck!


No comments:

Post a Comment