SQL SERVER 2005 Data Type convertion to VB.NET 2.0

  • Thread starter Thread starter Flavio
  • Start date Start date
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
 
Flavio said:
Hi guys,

what i'm trying to do is to create a Dynamic class generator based on
tables from a sql2005 database.

Why not check out MyGeneration? It does all that for you and there are
several architectures available to choose from, or you can write your own
templates for your own architecture.

And it's free.

http://www.mygenerationsoftware.com
 
Matt said:
Why not check out MyGeneration? It does all that for you and there are
several architectures available to choose from, or you can write your own
templates for your own architecture.

And it's free.

http://www.mygenerationsoftware.com
OK, i'm by now taking a look to MyGeneration, and i'm sure that it is
very, very usefull.

I'm a vb.net 2.0 starter, and i'm building a kind of 'Business Rules
Layer' builder for my applications.

i'm searching for a kind of "Patterns and Good pratices" for optimize My
applications.

where can i find example, atricles or tutorials to use vb.net 2.0 with
SQL Server 2005(experss)????

Thanks, for helpping
Flávio oliveira
 
Flavio said:
I'm a vb.net 2.0 starter, and i'm building a kind of 'Business Rules
Layer' builder for my applications.

i'm searching for a kind of "Patterns and Good pratices" for optimize
My applications.

As I said, MyGeneration has templates for a bunch of architectures. dOOdads,
EasyObjects, nHibernate and more. If you are looking for a data layer
architecture, there are plenty to choose from. If you want to write your
own, you can do that too.

where can i find example, atricles or tutorials to use vb.net 2.0 with
SQL Server 2005(experss)????

There are examples of how to write your own templates on the MyGen site.
Look on the Documentation menu. Or you can look at existing templates to see
how they are written.
 
Back
Top