So, there is a database with x tables and one class per table.
The user is allowed to chose which table-content he/she wants
to see, by checking it.
I read the selected table and store the name in a string, then
I call the SUB to output the content of the selected table.
In this SUB I want to create an instance of the class corresponding
to the table the user chosed.
' Example Code
Privtae Sub OutputData(ByVal table as String)
Dim tableClass as Object
' Here is what I'm looking for - how can I create an instance from
a class if
' I only know the name of the class stored in a string?
tableClass = GetInstance(table)
Thanks for your help!
On 4 Feb., 14:30, Fabio Maulo <[email protected]> wrote:
> I don't understand exactly what you need but:
> a entity can be spanned in more than one table
> a table can contain more than one entity and even more than one class
>
> 2010/2/4 Marco <[email protected]>
>
>
>
> > Hello Group :-)
>
> > I'm writing an NHibernate Application in VB.NET and try to do
> > something like the following:
>
> > '
>
> > ----------------------------------------------------------------------------------------------------------------------
> > ' Here we go...
> > Dim tableName as String = "NameOfTable"
> > Dim tableObject as Object
>
> > ' Caution: This line is pure fantasy....
> > tableObject = GetObjectFromNHibernateMapping(tableName)
>
> > ' Back to reality
> > Dim AllRecordsFromTableName as IList =
> > CreateCriteria(GetType(tableObject)).List
>
> > ' More Code to write...
> > '
>
> > ----------------------------------------------------------------------------------------------------------------------
>
> > So, how can I create Objects from NHibernate Mapping at running,
> > because I have to be
> > flexible wich table I want to edit respectivly which content I want to
> > show
>
> > Any help is appreciated
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "nhusers" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected]<nhusers%[email protected]>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/nhusers?hl=en.
>
> --
> Fabio Maulo
--
You received this message because you are subscribed to the Google Groups
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/nhusers?hl=en.