I have the following code segment:
var framelist = BL.FooBL.GetFrame() ;
var
foreach( var i in framelist)
{
DropDownList.Items.Add(new ListItem(i.FrameModel,i.FrameTypeID)));
}
I want to cast i.FrameTypeID from integer type to string type, but when I try to cast like this :
(i.FrameModel,(string)i.FrameTypeID)
But I get Error:
Invalid anonymus type member declaration.
How can I convert this field to string inside Foreach statement?
You have a var floating out in your code there. This has nothing to do with the
Additself.