---
title: "CANNOT IMPLICITLY CONVERT TYPE 'LONG?' TO 'LONG'."  
description: "CANNOT IMPLICITLY CONVERT TYPE 'LONG?' TO 'LONG'."  
author: "Anonymous User"  
published: 2018-04-17  
updated: 2018-04-17  
canonical: https://www.mindstick.com/forum/34469/cannot-implicitly-convert-type-long-to-long  
category: "asp.net"  
tags: ["c#", "asp.net mvc"]  
reading_time: 1 minute  

---

# CANNOT IMPLICITLY CONVERT TYPE 'LONG?' TO 'LONG'.

Error 1 Cannot implicitly [convert](https://www.mindstick.com/forum/2093/configurationmanager-appsettings-convert-n-to-n-why) type '[long](https://www.mindstick.com/articles/44565/white-wedding-dresses-long-prom-dresses)?' to 'long'. An [explicit](https://www.mindstick.com/interview/2677/can-you-explain-about-implicit-and-explicit-type-casting) [conversion](https://www.mindstick.com/forum/1734/conversion-from-32-bit-integer-to-4-chars) [exists](https://www.mindstick.com/forum/158947/how-do-you-use-the-exists-operator-to-check-for-the-existence-of-records-in-a-subquery) (are you [missing](https://answers.mindstick.com/qa/52138/international-missing-children-s-day-2019-was-observed-on) a [cast](https://answers.mindstick.com/qa/97273/how-to-cast-a-baitcaster)?)

```
  select new post
           {
           ID = r.ID,
          Title = r.Title,
          PostedDate = r.CreationDate,
       DeletedOn = r.ModificationDate,

       ModifiedBy = r.ModifiedBy

      })
```

in modifiedBy its [showing error](https://www.mindstick.com/forum/23295/showing-error-while-back-up-the-database-in-sql-server) of typecast

please help me

## Replies

### Reply by Anonymous User

write following code

```
 select new post
                {
        ID = r.ID,
        Title = r.Title,
        PostedDate = r.CreationDate,
        DeletedOn = r.ModificationDate,

        ModifiedBy = (long)r.ModifiedBy
      })
```


---

Original Source: https://www.mindstick.com/forum/34469/cannot-implicitly-convert-type-long-to-long

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
