IMPLICITLY CANNOT CONVERT cHAR TO BOOLEAN

Posted by Self-Innovator under ASP.NET on 4/2/2012 | Points: 10 | Views : 1563 | Status : [Member] | Replies : 5
Hi i've an issue
if (ds2.Tables[0].Rows.Count > 0)
{
int i = 0,j=0,k=0;
int count = 0;
char[] arr1=new char[ds2.Tables[0].Rows[0][0].ToString().ToCharArray().Length];
char[] result = new char[ds2.Tables[0].Rows[0][0].ToString().ToCharArray().Length];
while (i < ds2.Tables[0].Rows.Count)
{
arr1 = ds2.Tables[0].Rows[i]["PrivilegeID"].ToString().ToCharArray();
if(i==0)
{
result=ds2.Tables[0].Rows[i+1]["PrivilegeID"].ToString().ToCharArray();
}
count = arr1.Length;
for (j = 0; j < count; j++)
{
result[j]=Convert.ToChar((Convert.ToBoolean(arr1[j]))||(Convert.ToBoolean(result[j])));
}
i++;
}

Error Cannot implicitly convert char to bool

Join Hands Change lives
Thanks & Regards
Straight Edge Society



Responses

Posted by: Balajikcp8 on: 4/2/2012 [Member] Starter | Points: 25

Up
0
Down
Can you show me your table?

Self-Innovator, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Rajni.Shekhar on: 4/2/2012 [Member] Bronze | Points: 25

Up
0
Down
check below link

http://stackoverflow.com/questions/3360403/convert-char-array-string-to-bool-array

Thanks,
Rajni Shekhar

Self-Innovator, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Self-Innovator on: 4/2/2012 [Member] Bronze | Points: 25

Up
0
Down
UserID PreviligeID
K001 1011110001100111110000001111111000100000100000000
K001 1001110000000001000000000000000000000000000000000
K001 1001110000000000000000000000000000000000000000000
This my Table....BalajiKCp

Join Hands Change lives
Thanks & Regards
Straight Edge Society

Self-Innovator, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sabarimahesh on: 4/3/2012 [Member] Bronze | Points: 25

Up
0
Down

Self-Innovator

i thought Error May in this line

result[j]=Convert.ToChar((Convert.ToBoolean(arr1[j]))||(Convert.ToBoolean(result[j])))




Life is a Race
Thanks & Regards
By
Sabari Mahesh P M

Self-Innovator, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sabarimahesh on: 4/3/2012 [Member] Bronze | Points: 25

Up
0
Down
Self-Innovator

i'll Response you quickly

Life is a Race
Thanks & Regards
By
Sabari Mahesh P M

Self-Innovator, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response