Click here to Skip to main content
15,884,237 members
Home / Discussions / C#
   

C#

 
GeneralRe: Find Control on webform Pin
Terick25-Feb-09 6:03
Terick25-Feb-09 6:03 
GeneralRe: Find Control on webform Pin
Terick25-Feb-09 6:28
Terick25-Feb-09 6:28 
GeneralRe: Find Control on webform Pin
Rutvik Dave25-Feb-09 8:43
professionalRutvik Dave25-Feb-09 8:43 
GeneralRe: Find Control on webform Pin
Terick25-Feb-09 11:04
Terick25-Feb-09 11:04 
QuestionDatetimepicker Pin
cdpace25-Feb-09 5:00
cdpace25-Feb-09 5:00 
AnswerRe: Datetimepicker Pin
PIEBALDconsult25-Feb-09 7:11
mvePIEBALDconsult25-Feb-09 7:11 
GeneralRe: Datetimepicker Pin
cdpace25-Feb-09 8:07
cdpace25-Feb-09 8:07 
QuestionGenerate class from schema with restrictions??? Pin
pankazmittal25-Feb-09 4:53
pankazmittal25-Feb-09 4:53 
Hi I am designing an XSD schema in which there is a field called SSN. This field has some restrictions like maxlength, type, format etc. All that is described in schema itself. Schema sample attached.

Now, I generate a C# class out of this schema using XSD.exe or XSDGen tool. They do create a class but none of them incorporates the restrictions (validation) specified in schema. Basically, I want object class to have a way to validate those restrictions.

How can I generate a class from schema which also includes the restriction on fields?

Thanks
Pankaj

Here is the schema sample ---


<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:simpletype name="ssnumber" final="restriction">
<xsd:restriction base="xsd:string">
<xsd:length value="11" />
<xsd:pattern value="\d{3}\-\d{2}\-\d{4}" />
</xsd:restriction>
</xsd:simpletype>
<xsd:element name="Employee">
<xsd:complextype>
<xsd:sequence>
<xsd:element name="SSN" type="ssnumber" />
<xsd:element name="Name" type="xsd:string" />
</xsd:sequence>
</xsd:complextype>
</xsd:element>
</xsd:schema>
QuestionHow to split Large XML files into number of small files Pin
Rizwan Bashir25-Feb-09 4:28
Rizwan Bashir25-Feb-09 4:28 
AnswerRe: How to split Large XML files into number of small files Pin
PIEBALDconsult25-Feb-09 5:13
mvePIEBALDconsult25-Feb-09 5:13 
GeneralRe: How to split Large XML files into number of small files Pin
Rizwan Bashir25-Feb-09 21:44
Rizwan Bashir25-Feb-09 21:44 
GeneralRe: How to split Large XML files into number of small files Pin
PIEBALDconsult26-Feb-09 3:28
mvePIEBALDconsult26-Feb-09 3:28 
Questionhow to make objects are visble/invisble.. Pin
priyareguri25-Feb-09 4:21
priyareguri25-Feb-09 4:21 
AnswerRe: how to make objects are visble/invisble.. Pin
Xmen Real 25-Feb-09 4:38
professional Xmen Real 25-Feb-09 4:38 
QuestionFolder Lock and Hiding. Pin
ncc1701e25-Feb-09 3:38
ncc1701e25-Feb-09 3:38 
AnswerRe: Folder Lock and Hiding. Pin
EliottA25-Feb-09 5:35
EliottA25-Feb-09 5:35 
GeneralRe: Folder Lock and Hiding. Pin
Curtis Schlak.25-Feb-09 9:23
Curtis Schlak.25-Feb-09 9:23 
GeneralRe: Folder Lock and Hiding. Pin
EliottA25-Feb-09 9:37
EliottA25-Feb-09 9:37 
GeneralRe: Folder Lock and Hiding. Pin
ncc1701e27-Feb-09 1:29
ncc1701e27-Feb-09 1:29 
QuestionRe: Folder Lock and Hiding. Pin
archananaresh29-Mar-09 19:14
archananaresh29-Mar-09 19:14 
QuestionLooping though Dataset Pin
kanchoette25-Feb-09 3:16
kanchoette25-Feb-09 3:16 
AnswerRe: Looping though Dataset Pin
Xmen Real 25-Feb-09 3:29
professional Xmen Real 25-Feb-09 3:29 
GeneralRe: Looping though Dataset Pin
kanchoette25-Feb-09 3:32
kanchoette25-Feb-09 3:32 
GeneralRe: Looping though Dataset Pin
Xmen Real 25-Feb-09 4:25
professional Xmen Real 25-Feb-09 4:25 
AnswerRe: Looping though Dataset Pin
PIEBALDconsult25-Feb-09 3:35
mvePIEBALDconsult25-Feb-09 3:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.