PC Review


Reply
Thread Tools Rate Thread

Differences reading XML into listbox in compact framework versus windows forms

 
 
John Murray
Guest
Posts: n/a
 
      27th May 2004
can anyone tell me why this same code works on a normal windows
platform but when used in compact framework application produces an
argument exception on setting either the valuemember or displaymember

ds = new DataSet();
string filePath = @"\Program Files\crp3\airf2.xml";
ds.ReadXml(filePath);
this.comboBox1.DataSource=ds;
this.comboBox1.ValueMember="airf2.ICAO";
this.comboBox1.DisplayMember="airf2.AIRFIELD";


TIA

John Murray
 
Reply With Quote
 
 
 
 
William Ryan eMVP
Guest
Posts: n/a
 
      27th May 2004
Hi John:

I don't have the XML file but I use the identical code in many of my apps
and don't have a problem. My guess is that it's the tablename airf2 that's
not being recognized. I'd double check the table count and verify the table
name. You could also just set the source to the table and use just the
field names....
this.comboBox1.DataSource=ds.Tables[0]; //Assuming there's only one table
this.comboBox1.ValueMember="ICAO";
this.comboBox1.DisplayMember="AIRFIELD";

If you want to send me a copy of the xml file, I'll be glad to test it under
both environments and see what I can find... but I'm guessing it's the
tablename.

If you want to send it to me , zing it to my work address wryan At
InfoProGroup Dot Com

(@infoprogroup.com)
--

W.G. Ryan, eMVP

http://forums.devbuzz.com/
http://www.knowdotnet.com/williamryan.html
http://www.msmvps.com/WilliamRyan/
http://www.devbuzz.com/content/zinc_...center_pg1.asp
"John Murray" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> can anyone tell me why this same code works on a normal windows
> platform but when used in compact framework application produces an
> argument exception on setting either the valuemember or displaymember
>
> ds = new DataSet();
> string filePath = @"\Program Files\crp3\airf2.xml";
> ds.ReadXml(filePath);
> this.comboBox1.DataSource=ds;
> this.comboBox1.ValueMember="airf2.ICAO";
> this.comboBox1.DisplayMember="airf2.AIRFIELD";
>
>
> TIA
>
> John Murray



 
Reply With Quote
 
Ilya Tumanov [MS]
Guest
Posts: n/a
 
      27th May 2004
John,

It's not working because it's not supported. You can not use dots in CF
data binding, anything like "airf2.ICAO" will result in ArgumentExeption.

To make it work, bind to the table, not to the DataSet. This would allow
you to remove dots and will work just fine.

Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
> From: (E-Mail Removed) (John Murray)
> Newsgroups: microsoft.public.dotnet.framework.compactframework
> Subject: Differences reading XML into listbox in compact framework versus

windows forms
> Date: 27 May 2004 07:26:09 -0700
> Organization: http://groups.google.com
> Lines: 15
> Message-ID: <(E-Mail Removed)>
> NNTP-Posting-Host: 82.68.178.158
> Content-Type: text/plain; charset=ISO-8859-1
> Content-Transfer-Encoding: 8bit
> X-Trace: posting.google.com 1085667969 13280 127.0.0.1 (27 May 2004

14:26:09 GMT)
> X-Complaints-To: groups-(E-Mail Removed)
> NNTP-Posting-Date: Thu, 27 May 2004 14:26:09 +0000 (UTC)
> Path:

cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.s
ul.t-online.de!t-online.de!news.glorb.com!postnews1.google.com!not-for-mail
> Xref: cpmsftngxa10.phx.gbl

microsoft.public.dotnet.framework.compactframework:54040
> X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
>
> can anyone tell me why this same code works on a normal windows
> platform but when used in compact framework application produces an
> argument exception on setting either the valuemember or displaymember
>
> ds = new DataSet();
> string filePath = @"\Program Files\crp3\airf2.xml";
> ds.ReadXml(filePath);
> this.comboBox1.DataSource=ds;
> this.comboBox1.ValueMember="airf2.ICAO";
> this.comboBox1.DisplayMember="airf2.AIRFIELD";
>
>
> TIA
>
> John Murray
>


 
Reply With Quote
 
John Murray
Guest
Posts: n/a
 
      30th May 2004
Thanks Ilya
I will givei it a whirl!!



(E-Mail Removed) ("Ilya Tumanov [MS]") wrote in message news:<(E-Mail Removed)>...
> John,
>
> It's not working because it's not supported. You can not use dots in CF
> data binding, anything like "airf2.ICAO" will result in ArgumentExeption.
>
> To make it work, bind to the table, not to the DataSet. This would allow
> you to remove dots and will work just fine.
>
> Best regards,
>
> Ilya
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
> --------------------
> > From: (E-Mail Removed) (John Murray)
> > Newsgroups: microsoft.public.dotnet.framework.compactframework
> > Subject: Differences reading XML into listbox in compact framework versus

> windows forms
> > Date: 27 May 2004 07:26:09 -0700
> > Organization: http://groups.google.com
> > Lines: 15
> > Message-ID: <(E-Mail Removed)>
> > NNTP-Posting-Host: 82.68.178.158
> > Content-Type: text/plain; charset=ISO-8859-1
> > Content-Transfer-Encoding: 8bit
> > X-Trace: posting.google.com 1085667969 13280 127.0.0.1 (27 May 2004

> 14:26:09 GMT)
> > X-Complaints-To: groups-(E-Mail Removed)
> > NNTP-Posting-Date: Thu, 27 May 2004 14:26:09 +0000 (UTC)
> > Path:

> cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.s
> ul.t-online.de!t-online.de!news.glorb.com!postnews1.google.com!not-for-mail
> > Xref: cpmsftngxa10.phx.gbl

> microsoft.public.dotnet.framework.compactframework:54040
> > X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
> >
> > can anyone tell me why this same code works on a normal windows
> > platform but when used in compact framework application produces an
> > argument exception on setting either the valuemember or displaymember
> >
> > ds = new DataSet();
> > string filePath = @"\Program Files\crp3\airf2.xml";
> > ds.ReadXml(filePath);
> > this.comboBox1.DataSource=ds;
> > this.comboBox1.ValueMember="airf2.ICAO";
> > this.comboBox1.DisplayMember="airf2.AIRFIELD";
> >
> >
> > TIA
> >
> > John Murray
> >

 
Reply With Quote
 
John Murray
Guest
Posts: n/a
 
      30th May 2004
Many thanks William - I have another suggestion about using ( or not)
'.''s so I will try that first


"William Ryan eMVP" <(E-Mail Removed)> wrote in message news:<#(E-Mail Removed)>...
> Hi John:
>
> I don't have the XML file but I use the identical code in many of my apps
> and don't have a problem. My guess is that it's the tablename airf2 that's
> not being recognized. I'd double check the table count and verify the table
> name. You could also just set the source to the table and use just the
> field names....
> this.comboBox1.DataSource=ds.Tables[0]; //Assuming there's only one table
> this.comboBox1.ValueMember="ICAO";
> this.comboBox1.DisplayMember="AIRFIELD";
>
> If you want to send me a copy of the xml file, I'll be glad to test it under
> both environments and see what I can find... but I'm guessing it's the
> tablename.
>
> If you want to send it to me , zing it to my work address wryan At
> InfoProGroup Dot Com
>
> (@infoprogroup.com)
> --
>
> W.G. Ryan, eMVP
>
> http://forums.devbuzz.com/
> http://www.knowdotnet.com/williamryan.html
> http://www.msmvps.com/WilliamRyan/
> http://www.devbuzz.com/content/zinc_...center_pg1.asp
> "John Murray" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > can anyone tell me why this same code works on a normal windows
> > platform but when used in compact framework application produces an
> > argument exception on setting either the valuemember or displaymember
> >
> > ds = new DataSet();
> > string filePath = @"\Program Files\crp3\airf2.xml";
> > ds.ReadXml(filePath);
> > this.comboBox1.DataSource=ds;
> > this.comboBox1.ValueMember="airf2.ICAO";
> > this.comboBox1.DisplayMember="airf2.AIRFIELD";
> >
> >
> > TIA
> >
> > John Murray

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Regular Windows Forms and Compact Framework Microsoft Dot NET Compact Framework 1 18th Jan 2007 10:11 PM
Differences between .Net and .Net compact framework 2.0 =?Utf-8?B?c3VzaGk=?= Microsoft Dot NET Compact Framework 4 16th Aug 2005 03:50 PM
Windows.Forms Issue (compact framework) Brett Miller Microsoft Dot NET Compact Framework 1 16th Jul 2004 11:22 PM
Windows.Forms Issue (compact framework) Brett Miller Microsoft Dot NET Framework Forms 0 8th Jul 2004 07:57 AM
Whats the main differences with the compact framework? =?Utf-8?B?SmF4?= Microsoft C# .NET 1 27th Feb 2004 11:04 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:59 PM.