Your best source of information and news about BIOS, software and vista on the internet

Vista ARTICLES TOP 50 Spyware Virus Vista SOFT Vista HELP

.NET Framework 2.0

You are currently browsing the articles from MS Windows Vista Compatible Software matching the category .NET Framework 2.0.

Generate Typed Dataset from an XSD file


Visual Studio 2005’s Typed DataSet is pretty cool. It gives you good control of what the relations should be and it pretty much mimics a table in the database. I love it. But one thing I hate about that is when you serialize your Typed DataSet your XML looks not up to the mark of what you want.

It does serves the purpose but it has all sorts of primary key/foreign key references that are serialized into the XML that at times we don’t want. Rather what we want is a nested XML structure that meaningfully makes sense if you wear that XML glass.

Adding an XSD file to your project won’t help right away as VSNET 2005 doesn’t directly generate dataset (.Designer.cs file) out of it. But, to our rescue, there is a work around to get VSNET 2005 generate typed-dataset from an XSD file. Here is what you should do,

  • Select the XSD file you want VSNET 2005 to generate typed-dataset from
  • Go into the XSD file’s properties
  • Set the "Build Action" to "Content"
  • Set the "Custom Tool" to point to "MSDataSetGenerator"

And that’s it. The next time you save the XSD file you should be able to see the dataset file, .Designer.cs (or .vb) file, for your XSD.

Visit DemoGeek.com for amazingly detailed quality articles on Computer, Internet, Browsers, Software, Programming and much more.

      

Written by askars on October 24th, 2008 with no comments.
Read more articles on .NET Framework and otherSoftware and .NET Framework 2.0 and howto and Visual Studio and .Net and Tips and Tricks.

Overloading Web Methods

It’s been a while since I got a chance to blog. Work and life was so busy to do anything other than those. Anyway, I’m back to my blogging habit and I hope to contribute the useful ones. To begin with,

How do you overload a web method?

You know you can leverage the OO concept with the web methods as well but once you try it out you’ll realize that it is not a straight forward ride. You have to tweak some of the header settings to let that happen. Here are the ones you have to tweak,

  • WebServiceBinding
  • MessageName

You have to make the WebServiceBinding conforms to WsiProfiles.None. And then you have to specify a Message Name so that you can distinguish between the overloaded methods in a descriptive way.

Here is an example,

[WebServiceBinding(ConformsTo = WsiProfiles.None)]
[WebMethod(MessageName = “Method1″, Description = “Description for Method1″)]

public string Method1(string input)

{    // implementation here    }

 

[WebServiceBinding(ConformsTo = WsiProfiles.None)]
[WebMethod(MessageName = “Method2″, Description = “Description for Method2″)]

public string Method2(string input)

{    // implementation here    }

tags: , , , , , ,

Written by askars on June 16th, 2007 with no comments.
Read more articles on .NET Framework 2.0 and Code Samples and howto and ASP.NET.