Hi guys,
I have such a script for getting data from db.
simply, i get data, and want to convert the data to an array.
But it gives me "CS0266: Cannot implicitly convert type 'object[]' to 'string[]'. An explicit conversion exists (are you missing a cast?)" error on the bold part below;
SqlDataReader reader = cmd.ExecuteReader();
ArrayList roleList = new ArrayList();
while (reader.Read()) {
roleList.Add(reader["groupName"]);
}
string[] roleListArray = roleList.ToArray(typeof(string));