473,800 Members | 2,523 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Please Help - Simple Question About LINQ Query

Hello guys,

I am creating a LINQ (to DataSet) query where I need to do something
like...

DataTable _TableNumberX = dtsMyDataSet.Ta bles["TableNumbe r" +
SomeVariableNum ber.ToString()];//this line OK

IEnumerable<Dat aRowrsResultSet =
from TableNumber[X] in _TableNumberX.A sEnumerable()
select TableNumber[X];

---

In the above example I need to be able to vary the "X" as different
numbers. For example, on query might use TableNumber2, and another
might use TableNumber126 . Now in the "from" clause if I try to use
something like...

from TableNumber + SomeVariableNum ber.ToString() in
_TableNumberX.A sEnumerable

....it doesn't work.

Can you guys please provide an example of how to make this work
properly?
Jun 27 '08 #1
0 741

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

Similar topics

11
12550
by: Alexander Vasilevsky | last post by:
Linq "into" and "let" equally??? http://www.alvas.net - Audio tools for C# and VB.Net developers
1
2235
by: 0to60 | last post by:
Let's say we have your basic Invoices and InvoiceItems table. If we load this in with LINQ: var query = from i in db.Invoices select i; When I then loop through my invoices, if I wanna access the lineItems for a particular invoice, LINQ runs another query behind the scenes and goes and gets them for me. So if I wanted to loop through my invoices and print out the number of invoices thusly:
8
46887
by: Andy | last post by:
Hi, I'm trying to add a where clause to my query: List<stringtypes = new List<string>(); types.Add( "A" ); types.Add( "B" ); query = query.Where( c =types.Contains( c.Type ) );
9
2505
by: =?Utf-8?B?cmF1bGF2aQ==?= | last post by:
Hi all: after reading different places/sites about linq... I ran into these questions: 1. What framework do we need to run linq ? (does it depend on what version of visual studio we have?) how about vs2008? is it different name space or framework for linq xml or linq sql? ( 2. do we need to have references to what linq's dlls. or namespaces? system core? 3. what name spaces are needed?
1
1843
by: shapper | last post by:
Hi, On a form I have an input where tags are inserted in a CSV format. Then on my code I convert the CSV string to a List<Tag>. Tag is an object with two properties: TagID and Name So when I do the conversion I only fill the Tags names ... Then I use a join to find these tags into my database.Tags and get their ID's.
14
3691
by: thj | last post by:
Hi, I was wondering what you guys are using and why? LINQ to SQL or NHibernate? Thanks in advance, Tommy
3
942
by: =?Utf-8?B?SmFtZXMgUGFnZQ==?= | last post by:
Hi all Having a mental block with linq! I have a simple aspx page with a button and a label. When the button is clicked I want the label to display the result of a simple query: i.e. Select name from MyTable where id = 1 This should return ‘peter’ - simplicity using sql I'm trying to do this with linq and getting nowhere (converting to string error)
10
997
by: Tony Johansson | last post by:
Hello! If I have this simple linq construction var temp = from o in myWorksheetList where o.ID == workSheetID select o.subFileID; This will always give only a singe record in temp which is the result from selct o.subfileID
1
3355
by: jbot | last post by:
I've got some pages that use linq to sql. When I look at the generated sql statements in sql server profiler, I see the same statements repeated. In the example below (from a linq data source selected statement), the same sql query is run against the database 3 times at: oStudent.Count oStudent(0).lkpstatus.studentstatus oStudent(0).lkpstatus.statuscategory Is this the expected behavior? I expected the select to be run only
0
10273
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10250
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10032
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7574
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5469
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4149
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2944
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.