[ Home | Forums | About | Sponsors ]
  Welcome, Guest. Please Login or Register
Google
 
Web gotmono.com
  We've upgraded the forum software.  Please login to enjoy the new features.  If there are any issues or concerns, please message admin.
  HomeHelpSearchLoginRegister  
 
Page Index Toggle Pages: 1
Send Topic Print
(Read 879 times)
d_v
YaBB Newbies
*
Offline

I Love Mono!
Posts: 5

How to set a DataGridView DataSource from websvc
Jan 5th, 2009, 7:07am
 
I notice that when I set a DataGridView's Datasource in C# 2.0, VS 2005.NET in a windows form (on Win XP) that it works fine.  I can call this code multiple times.  (Valid select query)
But when I run the same .exe on the latest version of Mono Framework 2.0 on OS X it fails on the 2nd assignment, but works fine the first time.

Error: "unhandled exception: Index is less than 0 or more than or equal to the list count.  Parameter name: index 1."  And then the form disappears and closes.

Part of my code:
DataSet ds = new DataSet();  
DataTable dt = new DataTable();  
 
ds = MyWebService.GetDataset(InitialClientLogin, sSQL, ParamValues, out sMsg).Copy();  
dt = ds.Tables[0]; // Setup table. Choose the first table, since that is only one returned.  

MyDataGirdView.DataSource = dt; //dt.DefaultView; Crashes in Mono 2.0 on 2nd assignment
Back to top
 
 
IP Logged
 
d_v
YaBB Newbies
*
Offline

I Love Mono!
Posts: 5

Re: How to set a DataGridView DataSource from websvc
Reply #1 - Jan 7th, 2009, 5:15am
 
It seems to work in Mono 2.2 RC1 for OSX.
Back to top
 
 
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print
 

Copyright © 2003-2008, The Mono Community
Website Design donated by IdeaZone.ca