I have the following code:
<code>
using(WPEntities db = new WPEntities())
{
int quoteID =from f in db.vw_FileGeneral
where f.ProductionFileID == prodID
select f.FileID;
Convert.ToInt16(quoteID);
</code>
And I am getting exceptions due to ObjectQuery<int> not able to convert to int. The query is returning just one object, but of course it returns a list (of one item in this case). How do I get that one item's value into quoteID?
Thanks in advance!
<code>
using(WPEntities db = new WPEntities())
{
int quoteID =from f in db.vw_FileGeneral
where f.ProductionFileID == prodID
select f.FileID;
Convert.ToInt16(quoteID);
</code>
And I am getting exceptions due to ObjectQuery<int> not able to convert to int. The query is returning just one object, but of course it returns a list (of one item in this case). How do I get that one item's value into quoteID?
Thanks in advance!