How map a biginit inside entity framework, and how to convert a string into biginit

c# entity-framework

Question

I have a field named assetid inside sql server with type Biginit.so how I can map this field inside entity framework, and convert a string to biginit. The biginit will be received as an XML string value such as:-

<operation> 
<operationstatus>Success</operationstatus> 
<resourcename>serverrr090909</resourcename> 
<assetid>2701</assetid> 
<message>Rack serverrr090909 added successfully</message> 
</operation>

So I am trying to write something such as :-

Var assetid =  message = doc.SelectSingleNode("/operation/message").InnerText;
// so how I can convert the string into biginit 

update

I wrote the following :-

    public void InsertOrUpdateRack(Rack rack,string username,long assetid)
            {       
//code goes here
    IT360ID = assetid,
                        }

but it raised the folloiwng error on IT360ID = assetid,Cannot implicitly convert type 'long' to 'int?'. An explicit conversion exists (are you missing a cast?). so how i can assign an int? field a long value?

1
0
8/2/2013 2:49:05 PM

Popular Answer

Just use a long (same as Int64):

long assetid = long.Parse(doc.SelectSingleNode("/operation/assetid").InnerText);
7
8/2/2013 2:37:29 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow