473,508 Members | 2,295 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to Convert .NET type to XSD type

2 New Member
Hi,

I am creating schema programatically and I would need a method to convert .NET type to XSD type so that I could pass on the type string to XMLQualifiedName class.

For example, I would need "string" for "System.String" , "time" for "System.DateTime"

Is there any utility existing for doing this ?

thanks
skt
Jul 5 '07 #1
3 1833
Dököll
2,364 Recognized Expert Top Contributor
Hi,

I am creating schema programatically and I would need a method to convert .NET type to XSD type so that I could pass on the type string to XMLQualifiedName class.

For example, I would need "string" for "System.String" , "time" for "System.DateTime"

Is there any utility existing for doing this ?

thanks
skt
I hope I understood you right, skt05001!

Have a look here: http://www.w3schools.com/schema/schema_dtypes_date.asp
Jul 5 '07 #2
skt05001
2 New Member
I hope I understood you right, skt05001!

Have a look here: http://www.w3schools.com/schema/schema_dtypes_date.asp
This document only explains about the valid schema for datetime. But my question is about the mapping between .NET type to XSD type. I need a function something like this :


public string nettype2xsdtype(Type nettype)
{
}

If I give 'System.String' type, I should get "string" - if I give "System.DateTime" type, I should get 'time'....

Is there any way to do this ?

thx
Jul 5 '07 #3
Dököll
2,364 Recognized Expert Top Contributor
This document only explains about the valid schema for datetime. But my question is about the mapping between .NET type to XSD type. I need a function something like this :

Expand|Select|Wrap|Line Numbers
  1. public string nettype2xsdtype(Type nettype)
  2. {
  3. }
  4.  
If I give 'System.String' type, I should get "string" - if I give "System.DateTime" type, I should get 'time'....

Is there any way to do this ?

thx
My apologies, I missed that. I thought you needed help with a schema. I will forward to the .NET forum for better help there.

In a bit!
Jul 6 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

19
7246
by: Lauren Quantrell | last post by:
I have a stored procedure using Convert where the exact same Convert string works in the SELECT portion of the procedure but fails in the WHERE portion. The entire SP is listed below....
1
5630
by: phancey | last post by:
I am trying to invoke a web service method dynamically. I have created a generic function that takes a method name, string of parameters and calls the web method using System.Reflection: ...
4
3601
by: Eric Lilja | last post by:
Hello, I've made a templated class Option (a child of the abstract base class OptionBase) that stores an option name (in the form someoption=) and the value belonging to that option. The value is...
4
17663
by: Ken Varn | last post by:
I have an unknown numeric Type object passed into a function. I want to run a conversion on a string to convert the string to that Type object and return an object of that type. Is there some way...
7
30751
by: Jim Bancroft | last post by:
Hi everyone, A basic one here, I think. I haven't found the pattern yet, but sometimes when I cast a variable to another type using the "C" style cast operator the compiler refuses to play...
3
8723
by: mrajanikrishna | last post by:
Hi Friends, I am accepting a number from the user entered in a textbox. I want to assign to a variable in my code and assignt this to that variable. double num1 = (double)txtNum1.text; ...
7
16620
by: groups | last post by:
This is my first foray into writing a generic method and maybe I've bitten off more than I can chew. My intent is to have a generic method that accepts a value name and that value will be...
19
14747
by: tshad | last post by:
I have a value in my sql table set to tinyint (can't set to bit). I am trying to move it into a boolean field in my program and have tried: isTrue = (int)dbReader and isTrue =...
9
17492
by: Marco Nef | last post by:
Hi there I'm looking for a template class that converts the template argument to a string, so something like the following should work: Convert<float>::Get() == "float"; Convert<3>::Get() ==...
0
10707
Debadatta Mishra
by: Debadatta Mishra | last post by:
Introduction In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information...
0
7225
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7123
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7326
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7383
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7498
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5627
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5053
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3182
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
766
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.