.NET Framework 2.0

Generate Typed Dataset from an XSD file

Posted on October 24, 2008. Filed under: .NET, .NET Framework, .NET Framework 2.0, HowTo, Tips and Tricks, Visual Studio | Tags: |

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.

Read Full Post | Make a Comment ( None so far )

Overloading Web Methods

Posted on June 16, 2007. Filed under: .NET Framework 2.0, ASP.NET, Code Samples, HowTo |

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: , , , , , ,

Read Full Post | Make a Comment ( None so far )

ASP.NET 2.0 Starter Kits – Password Length Minimum Error

Posted on March 22, 2007. Filed under: .NET, .NET Framework, .NET Framework 2.0, .NET Framework 3.0, ASP.NET, Code Samples, Tips and Tricks |

I was getting my hands dirty last evening with the ASP.NET Club Starter Kit. It was pretty neat for the most part that the installation was a piece of cake and bringing it up and running was also a cake walk. But when I tried to create a new member it kept complaining about “Password length minimum: 7. Non-alphanumeric characters required: 1“.

I made sure that the password length was 7 or more. No luck.

The second part of the error message was so misleading that I tried with at least 1 alpha numeric character and no luck this time as well. Then I happened to <stress>read</stress> the error message and it said Non-alphanumeric, like ! @ # $ %…any of those. It worked when I did that.

I’m sure you don’t want your users to get confused with that error message and so if you want to take control of that follow these simple steps,

  • Open your Machine.config file (C:\Windows\Microsoft.NET\Framework\<version>\Config)
  • Look for the <Membership> node
  • Copy the whole node into your web application’s Web.config file
  • Modify the values as needed.

That <membership> node should go under the <System.Web> and you might want to add this line before the <add> node.

<remove name=”AspNetSqlMembershipProvider”/>

Otherwise it is going to complain about an attempt to add duplicate membership nodes.

tags: , , , , , , ,

~

Read Full Post | Make a Comment ( 2 so far )

Unable to start debugging on the server…Visual Studio .NET 2003 error

Posted on February 21, 2007. Filed under: .NET, .NET Framework, .NET Framework 2.0, ASP.NET, HowTo, Opinions, Tips and Tricks, Tools |

This was a bit so frustrating. Here are the list of events that got me trapped into this error that took me a while to resolve it,

  • Installed .NET Framework 1.1
  • Installed Visual Studio .NET 2003
  • Installed .NET Framework 2.0
  • Installed Visual Studio .NET 2005

Then when I tried to run an ASP.NET application it gave me terrible time with the “Unable to start debugging on the server. You do not have permissions to debug on the server” and then it said that I need to be part of the “Debugger Users” group.

I knew few resolutions about this by myself as I’ve faced these kind of problems before at work. So the first thing I did was to go to the IIS “Default Web Site” (and even to the specific web site in some cases) “Properties” and making sure in the ASP.NET tab that the correct ASP.NET runtime is selected. Most of the time after you install 2.0 after 1.1 framework it resets/defaults the ASP.NET runtime on the ASP.NET tab to 2.0. So I normally have to reset that to ASP.NET 1.1 runtime. I did the same this time as well thinking that should resolve. Nope, it didn’t.

Then I made sure my local account is part of the Debugger Users group. Indeed it was part of the group already. Then my venture was to make sure in IIS my ASP.NET application is created as an application (click the Create button on the Home Directory tab in IIS > Default Web Site > your web site). Indeed it was already.

Then the next venture, to make sure that the virtual directory folder is not read-only. It was read-only and I unchecked the check box to make it readable. No luck.

Then the next venture, to re-establish the IIS endpoints by running the “aspnet_regiis.exe”. No luck this time as well.

Then I started looking for resolutions (with my best friend Google). I tried almost all the pointers on the search results that came up. Even (embarrassingly) I re-installed Visual Studio .NET 2003 (couldn’t repair and so I had to re-install) Duh!!! No luck.

Then came this pointer to have the “User Authentication Logon” to be “Automatic logon with current username and password” under the “Security Settings” for both Internet and Local Intranet zones in Internet Explorer. Bingo!!!

I was able to debug my ASP.NET application. Enough learning experience on this to make my ASP.NET application debuggable.

Thanks to all those who contributed on those Google search results.

Hope it’s useful to you as well.

 tags: , , , , , , , , , , ,

~

Read Full Post | Make a Comment ( 2 so far )

  • May 2024
    M T W T F S S
     12345
    6789101112
    13141516171819
    20212223242526
    2728293031  
  • Del.icio.us

  • Subscribe

    Subscribe in NewsGator Online

    Subscribe in Rojo

    Add WinDev to Newsburst from CNET News.com

    Add to My AOL

    Add to netvibes

    Subscribe in Bloglines

    Subscribe in NewsAlloy

    Add WinDev to ODEO

    Subscribe in podnova

    Add to Pageflakes

Liked it here?
Why not try sites on the blogroll...