c# - I get an error that says cannot implicitly convert string type to int. -


i have xml nodelist child node named "rating" rating of int type

progressbar1.value = xlist[0].childnodes[1].firstchild.value; 

how use tostring method here? tried putting @ end of line still doesnt work

progressbar.value property int xmlnode.value returns string. , error pointed, there no implicit conversation string int.

if xmlnode.value value valid integer, need parse integer int32.parse method like;

progressbar1.value = int32.parse(xlist[0].childnodes[1].firstchild.value); 

Comments

Popular posts from this blog

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -

php - Prepared Statement Inner Join Cannot Pass Parameter by Reference -

c# - Value cannot be null or empty.\r\nParameter name: name -