Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

i am trying to excecute a linq query. In the Linq query i am selecting values from a view. This is the code in my webservice:

[WebMethod]
        public XmlDocument HelloWorld()
        {
            DatawarehouseDataContext db = new DatawarehouseDataContext();
            XElement xml =
                new XElement("xmltag",
                    from p in db.vTurnoverInternetAndResellerInPeriods
                    select p.Internet_Sales);

            XmlDocument doc = new XmlDocument();
            doc.Load(xml.CreateReader());

            return doc;
        }

I added the view i am using to my Linq to classes DMBL. Also i don't get any errors in the code.

but when i run this, i don't get any result. the webpage just keeps loading. I am very new to LinQ, so can someone please help me?

share|improve this question
 
For debugging purposes I recommend that you try your code in a simple Console application (you might need to reference your other project to access the required classes). That way, you can find out if it's really LINQ that's causing the problem or the webservice interface. In addition, you can step through the code and pinpoint the exact location of the problem. –  Heinzi Nov 6 at 15:51
 
i can't use the debug option because it doesn't reach the method HelloWorld. it keeps loading. what console application do you reccomend? The webmethod won't go further than the XElement line –  user2939331 Nov 6 at 15:57
 
You can create a console application in Visual Studio with File/New/Project/Visual C#/Windows/Console Application. That should be easier to debug than a web application. –  Heinzi Nov 6 at 16:06
 
What happens when you run the following in Sql Server Management Studio. SELECT * FROM vTurnoverInternetAndResellerInPeriods –  user1576573 Nov 6 at 16:16

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.