473,322 Members | 1,421 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Non-Shared Member

Using this line of code:
Dim q = From Member In BirthdaysDataSet.Member Select Member.MName
I'm told that it "Reference to a non-shared member requires an object reference".
The dataset exists in the Data Sources.
What am I missing?
Earl

Jun 27 '08 #1
4 1132


Dim ds as new BirthdaysDataSet
Dim q = From Member In ds.Member Select Member.MName
"Earl Partridge" <ea*****@pearnet.comwrote in message
news:uV*************@TK2MSFTNGP06.phx.gbl...
Using this line of code:
Dim q = From Member In BirthdaysDataSet.Member Select Member.MName
I'm told that it "Reference to a non-shared member requires an object
reference".
The dataset exists in the Data Sources.
What am I missing?
Earl

Jun 27 '08 #2
Thanks. That got rid of the error but I do a Q.count and the count is zero?
I have all this in a Timer event.
Earl
"Bill McCarthy" <Bi**@N0SPAM.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>

Dim ds as new BirthdaysDataSet
Dim q = From Member In ds.Member Select Member.MName
"Earl Partridge" <ea*****@pearnet.comwrote in message
news:uV*************@TK2MSFTNGP06.phx.gbl...
Using this line of code:
Dim q = From Member In BirthdaysDataSet.Member Select Member.MName
I'm told that it "Reference to a non-shared member requires an object
reference".
The dataset exists in the Data Sources.
What am I missing?
Earl

Jun 27 '08 #3
Uhm, yes that is to be expected. I'm not sure you're ready for this, but
here goes ... <g>

q in this case is referred to as a projection. It's an IEnumerable, that's
all. Well actually an IEnumerable(Of String) probably. To work with q you
have touse a For Each loop as that causes the IEnumerable to step through
the items as you do. Alternatively, you can make the projection a list and
have that for each done for, eg:

Dim q = From Member In ds.Member Select Member.MName

Dim names = q.ToList
Also, I'd suggest you turn Option Strict On, as that will give you a design
time error for things that aren't there. That being said, I don't know how
you did a Q.Count on the q from the query.


"Earl Partridge" <ea*****@pearnet.comwrote in message
news:eU**************@TK2MSFTNGP05.phx.gbl...
Thanks. That got rid of the error but I do a Q.count and the count is
zero?
I have all this in a Timer event.
Earl
"Bill McCarthy" <Bi**@N0SPAM.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>>

Dim ds as new BirthdaysDataSet
Dim q = From Member In ds.Member Select Member.MName
"Earl Partridge" <ea*****@pearnet.comwrote in message
news:uV*************@TK2MSFTNGP06.phx.gbl...
Using this line of code:
Dim q = From Member In BirthdaysDataSet.Member Select Member.MName
I'm told that it "Reference to a non-shared member requires an object
reference".
The dataset exists in the Data Sources.
What am I missing?
Earl

Jun 27 '08 #4
The q count was done with MsgBox (q.count)...
I had this thing working correctly yesterday (in that Timers thread) but I
got things
so scattered and confused I deleted everything (kept a copy of my code),
even
uninstalled VB 2008, reinstalled it and started from scratch. The code I
saved from
yesterday produced errors, probably because I consolidated everything into a
single (different) folder.

Thanks for sticking with me. I'll try your suggestion.
Earl
"Bill McCarthy" <Bi**@N0SPAM.comwrote in message
news:CC**********************************@microsof t.com...
Uhm, yes that is to be expected. I'm not sure you're ready for this, but
here goes ... <g>

q in this case is referred to as a projection. It's an IEnumerable,
that's all. Well actually an IEnumerable(Of String) probably. To work
with q you have touse a For Each loop as that causes the IEnumerable to
step through the items as you do. Alternatively, you can make the
projection a list and have that for each done for, eg:

Dim q = From Member In ds.Member Select Member.MName

Dim names = q.ToList
Also, I'd suggest you turn Option Strict On, as that will give you a
design time error for things that aren't there. That being said, I don't
know how you did a Q.Count on the q from the query.


"Earl Partridge" <ea*****@pearnet.comwrote in message
news:eU**************@TK2MSFTNGP05.phx.gbl...
>Thanks. That got rid of the error but I do a Q.count and the count is
zero?
I have all this in a Timer event.
Earl
"Bill McCarthy" <Bi**@N0SPAM.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>>>

Dim ds as new BirthdaysDataSet
Dim q = From Member In ds.Member Select Member.MName
"Earl Partridge" <ea*****@pearnet.comwrote in message
news:uV*************@TK2MSFTNGP06.phx.gbl...
Using this line of code:
Dim q = From Member In BirthdaysDataSet.Member Select Member.MName
I'm told that it "Reference to a non-shared member requires an object
reference".
The dataset exists in the Data Sources.
What am I missing?
Earl


Jun 27 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: lothar | last post by:
re: 4.2.1 Regular Expression Syntax http://docs.python.org/lib/re-syntax.html *?, +?, ?? Adding "?" after the qualifier makes it perform the match in non-greedy or minimal fashion; as few...
5
by: klaus triendl | last post by:
hi, recently i discovered a memory leak in our code; after some investigation i could reduce it to the following problem: return objects of functions are handled as temporary objects, hence...
3
by: Mario | last post by:
Hello, I couldn't find a solution to the following problem (tried google and dejanews), maybe I'm using the wrong keywords? Is there a way to open a file (a linux fifo pipe actually) in...
25
by: Yves Glodt | last post by:
Hello, if I do this: for row in sqlsth: ________pkcolumns.append(row.strip()) ________etc without a prior:
32
by: Adrian Herscu | last post by:
Hi all, In which circumstances it is appropriate to declare methods as non-virtual? Thanx, Adrian.
22
by: Steve - DND | last post by:
We're currently doing some tests to determine the performance of static vs non-static functions, and we're coming up with some odd(in our opinion) results. We used a very simple setup. One class...
8
by: Bern McCarty | last post by:
Is it at all possible to leverage mixed-mode assemblies from AppDomains other than the default AppDomain? Is there any means at all of doing this? Mixed-mode is incredibly convenient, but if I...
0
by: amitvps | last post by:
Secure Socket Layer is very important and useful for any web application but it brings some problems too with itself. Handling navigation between secure and non-secure pages is one of the cumbersome...
399
by: =?UTF-8?B?Ik1hcnRpbiB2LiBMw7Z3aXMi?= | last post by:
PEP 1 specifies that PEP authors need to collect feedback from the community. As the author of PEP 3131, I'd like to encourage comments to the PEP included below, either here (comp.lang.python), or...
12
by: puzzlecracker | last post by:
is it even possible or/and there is a better alternative to accept input in a nonblocking manner?
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.