ASp.net c# sql

February 17, 2011

Generate Structured Class from xml file

Filed under: asp.net c#, Asp.net, c#, mssql, XML, xml — Tags: , , , , , — Admin @ 1:36 pm

Tired of writing .cs class?

we can generate it see example below…

I created a test.xml file

<test>

<field1>hi</field1>

<field2>bye</field2>

</test>

Step1:

Run visual studio command promt

step2: move to the folder where test.xml is saved and execute below command

xsd test.xml

Above command will generate xsd file based on test.xml

and then execute below command to generate the .cs file

xsd /c test.xsd

Done.

You can easily generate .cs file from xml file.

 

 

Now

 

Create a free website or blog at WordPress.com.