April 28, 2011

Convert type string to string[ ]

Many peoples asked about the errors that might be occur while conversion in strings. Error is
Cannot implicitly convert type 'string' to 'string[]'

There is very big difference between Convert.ToString() and string[]

Convert.ToString = It converts your array of string into single string instance

For the following code use this

string[] getRoleType = (string[])Session["Role"];