|
-
Apr 7th, 2008, 02:24 PM
#1
[RESOLVED] [2005] Database->?->LINQ->XML
To cut to the point, I will have to use "LINQ to XML" to make an XML document, and the data I will use will come from a database. But the assignment says nothing about how to get the data from the database.
Is there any ASP.NET natural way to pull this off as you see it? Is it maybe possible to pragmatically pull data out of a object datasource maybe? Or would that be like jumping over the fence to fetch something that is already in your back yard?
- ØØ -
-
Apr 7th, 2008, 02:39 PM
#2
Re: [2005] Database->?->LINQ->XML
Well you can connect to a database and run queries all from LINQ. check out this guide from MS: http://msdn2.microsoft.com/en-us/library/bb425822.aspx
-
Apr 7th, 2008, 03:13 PM
#3
Re: [2005] Database->?->LINQ->XML
Thanks, but I see this document is written for .NET 3.5. Was this even implemented in VS 2005?
- ØØ -
-
Apr 7th, 2008, 03:24 PM
#4
Re: [2005] Database->?->LINQ->XML
 Originally Posted by NoteMe
Thanks, but I see this document is written for .NET 3.5. Was this even implemented in VS 2005?
- ØØ -
Well you posted stated you were using 2005 but LINQ is only in 2008 and you had said you wanted to use LINQ to Xml so I assumed you put the wrong version.
Yeah, if you want to use LINQ then you have to have 2008. If you're just looking for a way to get data from a database then you can use the built in .Net classes or try out the Enterprise Library Blocks from Microsoft which makes database access a breeze.
-
Apr 7th, 2008, 05:11 PM
#5
Re: [2005] Database->?->LINQ->XML
Create your 'entity' class to mirror what's in your table set, make sure it inherits from DataContext, then use your LINQ on it. Because you can then shape the data, you can create a new XDocument, XMLDocument, whatever you want as the 'returned' item from the query. Then save it.
-
Apr 9th, 2008, 11:38 AM
#6
Re: [2005] Database->?->LINQ->XML
Well you posted stated you were using 2005 but LINQ is only in 2008 and you had said you wanted to use LINQ to Xml so I assumed you put the wrong version.
No I ment 2005, and I ment LINQ. Maybe not in production environments, but for Uni using LINQ in 2005 works well using the May 2006 CTP.
Create your 'entity' class to mirror what's in your table set, make sure it inherits from DataContext, then use your LINQ on it. Because you can then shape the data, you can create a new XDocument, XMLDocument, whatever you want as the 'returned' item from the query. Then save it.
I would never have figguered out the save part my self No really, cheers. Believe it or not, I got it working. So it seems I managed the whole semester while working 100% in 3months + Wooohooo. No I will use the rest of the year reading poetry 
Cheers,
- ØØ -
-
Apr 9th, 2008, 03:44 PM
#7
Re: [RESOLVED] [2005] Database->?->LINQ->XML
Mind sharing some code then?
Let's see what you've done. Unless it's highly confidential.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|