Monday, March 19, 2012

list sql server data types

hello,

im trying to make an we application, that from it i can create a database and table to the server

i created the database.

but i want to create the tables too, but the problem is how can i list the data types of the sql server in the aspx page so i can create the tables with columns of requuired types.

Kind Regards

Mahmoud ManasrahI believe you could use the collection System.Data.SQLTypes. I don't know that you could bind directly to the collection, but you could iterate through it adding it to a bindable object (like a dataset for instance). HTH|||thank you

its a cool idea, this is what i was looking for

but im trying to do the code to iterate through this collection, but still didnt reach it

can u tell me how can i write the code

Kind Regards|||How about
foreach(Object myType in System.Data.SqlTypes)
if (myType.GetType().Name.Substring(0,3) == "Sql")

I haven't tested this, just maybe a starting point.

No comments:

Post a Comment