Groups | Blog | Home
all groups > dotnet compact framework > may 2007 >

dotnet compact framework : What is up with - The Targeted Version of the .net Compact Framework does not support latebound overload resolution


Loogie
5/28/2007 7:42:11 AM
I am trying to add contents of a table to a listview. I am using VB.Net
2005 compact framework. I can not add the subitems using code below. I
get an error for each subitem as follows:

The targeted version of the .net Compact Framework does not support
latebound overload resolution

Dim cmd As New System.Data.SqlServerCe.SqlCeCommand("Select p_item,
p_code, p_name from product", ssceconn)
Dim myReader As SqlCeDataReader = cmd.ExecuteReader()
Dim lvi As ListViewItem

While myReader.Read()
lvi = lsGlobals.Form4.lsvProds.Items.Add(myReader("p_item"))
lvi.SubItems.Add(myReader("p_code")) 'error thrown here
lvi.SubItems.Add(myReader("p_name")) 'error thrown here
End While

Any help as to how I can add the 3 fields to my listview?

Thanks

ctacke/
5/28/2007 7:54:45 AM
My VB is rusty so the syntax may need slight adjustment, but something like
this:

While myReader.Read()
lvi = new ListViewItem( new string() {myReader("p_item"),
myReader("p_code"), myReader("p_name"))
lsGlobals.Form4.lsvProds.Items.Add(lvi)
End While


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Managed Code in an Embedded World
www.OpenNETCF.com



[quoted text, click to view]

Loogie
5/28/2007 10:33:07 AM
[quoted text, click to view]

This looks like it works.

Thanks

James Caan
5/28/2007 2:14:14 PM
Try instead of myReader("x"):

myReader("x").ToString
or
Convert.ToString(myReader("x"))



"Loogie" <boogieloogie@gmail.com> schrieb im Newsbeitrag
news:f3ebm0$ot5$1@news.datemas.de...
[quoted text, click to view]
AddThis Social Bookmark Button