•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C# section within the Software Development category of DaniWeb, a massive community of 426,525 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 1,857 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C# advertiser: Programming Forums
Views: 325 | Replies: 5
![]() |
•
•
Join Date: Jul 2008
Posts: 15
Reputation:
Rep Power: 1
Solved Threads: 0
Hiho C# people!
I have a problem while compiling this:
Error 1 ) expected C:\..\Program.cs 14 51 ConsoleApplication5
Error 2 ; expected C:\..\Program.cs 14 75 ConsoleApplication5
Error 3 ; expected C:\..\Program.cs 14 82 ConsoleApplication5
Error 4 ; expected C:\..\Program.cs 14 123 ConsoleApplication5
Error 5 Invalid expression term ')' C:\..\Program.cs 14 123 ConsoleApplication5
I think i forgot a reference and using System.somthing
Can someone helpe me out?
I have a problem while compiling this:
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using System.Xml.Linq;
namespace ConsoleApplication5
{
class Program
{
static void Main(string[] args)
{
XDocument test = XDocument.Load(dataPath + "c:\\test.xml");
var result = new XElement("dbs", from test.Descendants("dbs") select new XElement("db", a.Element("id").Value));
Console.WriteLine(result);
}
}
}Error 1 ) expected C:\..\Program.cs 14 51 ConsoleApplication5
Error 2 ; expected C:\..\Program.cs 14 75 ConsoleApplication5
Error 3 ; expected C:\..\Program.cs 14 82 ConsoleApplication5
Error 4 ; expected C:\..\Program.cs 14 123 ConsoleApplication5
Error 5 Invalid expression term ')' C:\..\Program.cs 14 123 ConsoleApplication5
I think i forgot a reference and using System.somthing
Can someone helpe me out?
Last edited by njitram : Jul 17th, 2008 at 7:59 am.
•
•
Join Date: Jul 2008
Posts: 89
Reputation:
Rep Power: 1
Solved Threads: 9
Hi,
In this links there are some videos. Are in VB.NET but you should be able of understand them.
http://www.asp.net/learn/linq-videos/
Regards,
Camilo
In this links there are some videos. Are in VB.NET but you should be able of understand them.
http://www.asp.net/learn/linq-videos/
Regards,
Camilo
•
•
Join Date: Jul 2008
Posts: 89
Reputation:
Rep Power: 1
Solved Threads: 9
Hi,
Wha you missed was 'a in', here is the correct way.
If you really are interested in understand that code the you should read some article about how to crate XML with LINQ. Here are some videos http://msdn.microsoft.com/en-us/vcsharp/aa336745.aspx
Also you can go to this link.
http://blog.paranoidferret.com/index...e-xml-parsing/
Hope this help.
Camilo
Wha you missed was 'a in', here is the correct way.
XDocument test = XDocument.Load(dataPath + "c:\\test.xml");
var result = new XElement("a", from a in test.Descendants("dbs") select new XElement("db", a.Element("id").Value));If you really are interested in understand that code the you should read some article about how to crate XML with LINQ. Here are some videos http://msdn.microsoft.com/en-us/vcsharp/aa336745.aspx
Also you can go to this link.
http://blog.paranoidferret.com/index...e-xml-parsing/
Hope this help.
Camilo
Last edited by camilojvarona : Jul 17th, 2008 at 12:19 pm.
![]() |
•
•
•
•
•
•
•
•
DaniWeb C# Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
api apple asp blogger blogging code computer development dom engine feed france gartner gdata google html internet leopard library linspire linux microsoft news open openoffice operating operating system os parliament programming reader rss search source standards switching system technology torvalds upgrade vista w3c weather web windows xml xoap xp
- Previous Thread: C# cWinThreads? and MFCs
- Next Thread: importing C++ code into C# via wrapper?


Linear Mode