Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP.NET (Non-Forum Related)
 ToArray problem
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

blackinwhite
Average Member

Turkey
657 Posts

Posted - 21 March 2006 :  06:39:12  Show Profile
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));
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000 Version 3.4.07