silverlight with WCF(get data through collections)
- by Piyush
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'