F
Flavio
Hi guys,
what i'm trying to do is to create a Dynamic class generator based on
tables from a sql2005 database.
To get the list of Colums from a specific table i Use: "select * from
INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = 'TableName'"
and that query returns for a datatable all basic and necessary
information for the creation process.
My problem is: how should i assign a data type do a class element
defenition as this example:
Dim strClassOut as string = ""
while myReader.Read()
strClassOut &= "Public def" & myReader("Column") & " as "
ReturnType(myReader("ColumnType"))
end while
private funtion ReturnType(ByVal str as string) as string
Dim strOut as string =""
Select case str
case "varchar"
strOut ="String"
case "bit"
strOut ="Boolean"
case "????????"
strOut ="??????"
end case
return strOut
end funtion
where can i See the correct convertion table? or some thing like this?
thanks
Flávio Oliveira
what i'm trying to do is to create a Dynamic class generator based on
tables from a sql2005 database.
To get the list of Colums from a specific table i Use: "select * from
INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = 'TableName'"
and that query returns for a datatable all basic and necessary
information for the creation process.
My problem is: how should i assign a data type do a class element
defenition as this example:
Dim strClassOut as string = ""
while myReader.Read()
strClassOut &= "Public def" & myReader("Column") & " as "
ReturnType(myReader("ColumnType"))
end while
private funtion ReturnType(ByVal str as string) as string
Dim strOut as string =""
Select case str
case "varchar"
strOut ="String"
case "bit"
strOut ="Boolean"
case "????????"
strOut ="??????"
end case
return strOut
end funtion
where can i See the correct convertion table? or some thing like this?
thanks
Flávio Oliveira