silverlight with WCF(get data through collections)

Posted by Piyush on Stack Overflow See other posts from Stack Overflow or by Piyush
Published on 2010-03-30T11:36:20Z Indexed on 2010/03/30 11:43 UTC
Read the original article Hit count: 471

Filed under:
|
|

in my silverlight page I am fetching the data through WCF
WCF is returning an BusinessEntityCollection that is the collection of rows

SqlParameter[] sqlParameter = new SqlParameter[]{new SqlParameter("@recordType",recordType)};
MenuEntity menuEntity;
MenuEntityCollection menuEntityCollection = new MenuEntityCollection();
using (SqlDataReader sqlDataReader = SqlHelper.ExecuteReader(_ConnectionString,CommandType.StoredProcedure,
StoredProcedures.GetMenus, sqlParameter))
{
if (sqlDataReader.Read())
{
menuEntity = new MenuEntity();
DataAccessHelper.GetEntity(sqlDataReader, menuEntity);
menuEntityCollection.Add(menuEntity);
}
}
return menuEntityCollection;


--> in silverlight page when I am calling WCF there I am getting an error
MenuEntity menuList = new MenuEntity();
menuList = e.Result; <-----error line

error: Cannot implicitly convert type
'System.Collections.ObjectModel.ObservableCollection' to 'FastTrackSLUI.AdminServiceReference.MenuEntity'

© Stack Overflow or respective owner

Related posts about Silverlight

Related posts about wcf