Cannot implicity convert type 'object ' to system.collection.arraylist

Developer

In the below code I have a method it throws error while executing

" Cannot implicitly convert type 'object' to 'System.Collections.ArrayList'"

Please help me to do this.

private string strGetIndentString()
{
        ArrayList nArr = new ArrayList();
        System.Text.StringBuilder strInfo = new System.Text.StringBuilder();

        if (Session["CHECKED_ITEMS"] != null)
            nArr = Session["CHECKED_ITEMS"];//throws error

        for (int i = 0; i < nArr.Count; i++)
             strInfo.Append(nArr[i].ToString() + ",");

        return strInfo.ToString().TrimEnd(",".ToCharArray());            
}
Mairaj Ahmad

Change your code like this where you are getting value form session

nArr=(ArrayList)Session["CHECKED_ITEMS"];

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Cannot implicity convert type System.Linq.Expression<System.Func<Object, bool>> to bool

From Dev

Cannot implicity convert type 'double' to 'string'

From Dev

Cannot implicity convert type "void" to "x"

From Dev

Cannot implicity convert type string to System.Func<string,int,string,string>

From Dev

Cannot implicity convert type 'int' to 'ushort' : already explicity cast

From Dev

LINQ - Cannot implicity convert type, An explicit conversion exsist

From Dev

Cannot implicity convert type void to string c#

From Dev

Cannot implicity convert type string to List use JavascriptSerializer

From Dev

cannot implicitly convert System.Type to object

From Dev

return different type than generic defined one Error: "Cannot implicity convert type List<A> to List<tableType>"

From Dev

Cannot Convert Type System.Collection.Generic.List<T>

From Dev

Assert.IsInstanceOfType cannot convert from object to System.Type

From Dev

Cannot convert type 'object[]' to 'System.Data.DataRow'

From Dev

Assert.IsInstanceOfType cannot convert from object to System.Type

From Dev

CS0266 - Cannot implicitly convert type "System IList" to "System ArrayList" - Software Testing

From Dev

Cannot implicitly convert type system.Data.EnumerableRowCollectio to System.collection.Generic.Ienumerable

From Dev

2 errors - Cannot implicitly convert type system.collection.generic.list<float> to float and cannot implicitly convert type float [] to float

From Dev

python3 can't convert bytes to object 'str' implicity

From Dev

Accessing ArrayList returned as type Collection<Object>

From Dev

Cannot implicitly convert type from System.Collection.Generic.IEnumerable.MyClass<Node> to MyClass<Node>

From Dev

cannot implicitly convert type system.collection.generic IEnumerable to models in group by linq c#

From Dev

Cannot Implicitly convert type "System.Collection.Generic.List<T>" to "T"

From Dev

Cannot implicitly convert type System.EventHandler to System.EventHandler<object> error

From Dev

PowerShell - Rename-Item : Cannot convert 'System.Object[]' to the type 'System.String' required by parameter 'NewName'

From Dev

Cannot convert an ArrayList with my custom object as its data type into the corresponding regular array

From Dev

Cannot convert an ArrayList with my custom object as its data type into the corresponding regular array

From Dev

Cannot implicity List into IEnumerable

From Dev

Type mismatch: cannot convert from ArrayList<?> to ArrayList<String> in tomcat 7

From Dev

SignalR error Cannot implicitly convert type 'System.Threading.Tasks.Task<object>' to 'string'

Related Related

  1. 1

    Cannot implicity convert type System.Linq.Expression<System.Func<Object, bool>> to bool

  2. 2

    Cannot implicity convert type 'double' to 'string'

  3. 3

    Cannot implicity convert type "void" to "x"

  4. 4

    Cannot implicity convert type string to System.Func<string,int,string,string>

  5. 5

    Cannot implicity convert type 'int' to 'ushort' : already explicity cast

  6. 6

    LINQ - Cannot implicity convert type, An explicit conversion exsist

  7. 7

    Cannot implicity convert type void to string c#

  8. 8

    Cannot implicity convert type string to List use JavascriptSerializer

  9. 9

    cannot implicitly convert System.Type to object

  10. 10

    return different type than generic defined one Error: "Cannot implicity convert type List<A> to List<tableType>"

  11. 11

    Cannot Convert Type System.Collection.Generic.List<T>

  12. 12

    Assert.IsInstanceOfType cannot convert from object to System.Type

  13. 13

    Cannot convert type 'object[]' to 'System.Data.DataRow'

  14. 14

    Assert.IsInstanceOfType cannot convert from object to System.Type

  15. 15

    CS0266 - Cannot implicitly convert type "System IList" to "System ArrayList" - Software Testing

  16. 16

    Cannot implicitly convert type system.Data.EnumerableRowCollectio to System.collection.Generic.Ienumerable

  17. 17

    2 errors - Cannot implicitly convert type system.collection.generic.list<float> to float and cannot implicitly convert type float [] to float

  18. 18

    python3 can't convert bytes to object 'str' implicity

  19. 19

    Accessing ArrayList returned as type Collection<Object>

  20. 20

    Cannot implicitly convert type from System.Collection.Generic.IEnumerable.MyClass<Node> to MyClass<Node>

  21. 21

    cannot implicitly convert type system.collection.generic IEnumerable to models in group by linq c#

  22. 22

    Cannot Implicitly convert type "System.Collection.Generic.List<T>" to "T"

  23. 23

    Cannot implicitly convert type System.EventHandler to System.EventHandler<object> error

  24. 24

    PowerShell - Rename-Item : Cannot convert 'System.Object[]' to the type 'System.String' required by parameter 'NewName'

  25. 25

    Cannot convert an ArrayList with my custom object as its data type into the corresponding regular array

  26. 26

    Cannot convert an ArrayList with my custom object as its data type into the corresponding regular array

  27. 27

    Cannot implicity List into IEnumerable

  28. 28

    Type mismatch: cannot convert from ArrayList<?> to ArrayList<String> in tomcat 7

  29. 29

    SignalR error Cannot implicitly convert type 'System.Threading.Tasks.Task<object>' to 'string'

HotTag

Archive