Click here to Skip to main content
15,879,348 members
Home / Discussions / C#
   

C#

 
AnswerRe: Random number Pin
Joshua Quick14-Jan-06 18:21
Joshua Quick14-Jan-06 18:21 
AnswerRe: Random number Pin
DigitalKing14-Jan-06 20:27
DigitalKing14-Jan-06 20:27 
GeneralRe: Random number Pin
Joshua Quick14-Jan-06 20:59
Joshua Quick14-Jan-06 20:59 
GeneralRe: Random number Pin
Colin Angus Mackay15-Jan-06 23:58
Colin Angus Mackay15-Jan-06 23:58 
QuestionHelp regarding window form in a window Pin
edel_ong14-Jan-06 17:46
edel_ong14-Jan-06 17:46 
AnswerRe: Help regarding window form in a window Pin
Joshua Quick14-Jan-06 18:30
Joshua Quick14-Jan-06 18:30 
QuestionC# casting problem object to string[] Pin
plsaiuser14-Jan-06 15:34
plsaiuser14-Jan-06 15:34 
AnswerRe: C# casting problem object to string[] Pin
Joshua Quick14-Jan-06 18:15
Joshua Quick14-Jan-06 18:15 
I see two issues here.

1) Your GetRowsList() method's return type is Object, but it actually returns an ArrayList. You lose type safety because of this. It would be better to make the return type more explicit such as ArrayList or at least ICollection.

2) You're casting the returned ArrayList into a string array, which of course it is not.


Here's a solution. Why not not make the return type of GetRowsList() a string[]? You can then convert the ArrayList to a string array and return that instead. Then you can remove the the cast done in the other function.

protected string[] GetRowsList(ref SqlDataReader oReader, long nStart, long nRows)
{
   ArrayList vaResultSet = new ArrayList();
   // Your code goes here...
   return (string[])vaResultSet.ToArray(typeof(string));
}

Questionimage 2 mpeg-2 Pin
Kin Tutnik14-Jan-06 14:11
Kin Tutnik14-Jan-06 14:11 
AnswerRe: image 2 mpeg-2 Pin
Sasuko14-Jan-06 14:33
Sasuko14-Jan-06 14:33 
Questionhow do I implement scrolling? PART 2 Pin
Sasuko14-Jan-06 13:46
Sasuko14-Jan-06 13:46 
AnswerRe: how do I implement scrolling? PART 2 Pin
Dave Kreskowiak14-Jan-06 16:10
mveDave Kreskowiak14-Jan-06 16:10 
AnswerRe: how do I implement scrolling? PART 2 Pin
Robert Rohde14-Jan-06 21:30
Robert Rohde14-Jan-06 21:30 
GeneralRe: how do I implement scrolling? PART 2 Pin
Sasuko15-Jan-06 0:41
Sasuko15-Jan-06 0:41 
GeneralRe: how do I implement scrolling? PART 2 Pin
Robert Rohde15-Jan-06 1:58
Robert Rohde15-Jan-06 1:58 
GeneralRe: how do I implement scrolling? PART 2 Pin
Sasuko15-Jan-06 4:05
Sasuko15-Jan-06 4:05 
GeneralRe: how do I implement scrolling? PART 2 Pin
Robert Rohde15-Jan-06 5:22
Robert Rohde15-Jan-06 5:22 
GeneralRe: how do I implement scrolling? PART 2 Pin
Sasuko15-Jan-06 5:39
Sasuko15-Jan-06 5:39 
QuestionDataGridBoolColumn Question Pin
lior654#hotmail.com14-Jan-06 12:30
lior654#hotmail.com14-Jan-06 12:30 
AnswerRe: DataGridBoolColumn Question Pin
Robert Rohde14-Jan-06 21:21
Robert Rohde14-Jan-06 21:21 
GeneralRe: DataGridBoolColumn Question Pin
lior654#hotmail.com17-Jan-06 4:03
lior654#hotmail.com17-Jan-06 4:03 
GeneralRe: DataGridBoolColumn Question Pin
Robert Rohde17-Jan-06 8:15
Robert Rohde17-Jan-06 8:15 
GeneralRe: DataGridBoolColumn Question Pin
lior654#hotmail.com17-Jan-06 11:02
lior654#hotmail.com17-Jan-06 11:02 
GeneralRe: DataGridBoolColumn Question Pin
Robert Rohde18-Jan-06 0:17
Robert Rohde18-Jan-06 0:17 
QuestionHelp Needed in C# Chess Game development Pin
usmanali12314-Jan-06 10:40
usmanali12314-Jan-06 10:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.