473,703 Members | 2,981 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help Please

Hi,

I was wondering if any could point me to an example or give me ideas on how
to dynamically create a form based on a database table? So, I would have a
table designed to tell my application to create certain textboxes, labels,
and combo boxes? Any ideas would be appreciated.

Thanks
Nov 15 '05 #1
23 3273
bB
Object serialization and deserialization would be something to look into.
Serialize your form object and save it as a blob, then when you want to make
an instance of the form, load the blob and then deserialize. Just an
idea...
"Jason" <no****@hotmail .com> wrote in message
news:uK******** ******@TK2MSFTN GP11.phx.gbl...
Hi,

I was wondering if any could point me to an example or give me ideas on how to dynamically create a form based on a database table? So, I would have a
table designed to tell my application to create certain textboxes, labels,
and combo boxes? Any ideas would be appreciated.

Thanks

Nov 15 '05 #2

Hi Jason,

I think you can handle in the Form's Load event.
In this event, you can open the database and retrieve all the information
from the table.
Then you can dynamic construct controls and set their property correctly.
At last, use Form.Controls.A dd() method to add them into the form.

If you have any unclear, please feel free to tell me.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: "Jason" <no****@hotmail .com>
| Subject: Help Please
| Date: Fri, 17 Oct 2003 17:30:56 -0600
| Lines: 10
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <uK************ **@TK2MSFTNGP11 .phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
| NNTP-Posting-Host: 64.207.45.37
| Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP11.phx.g bl
| Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1922 42
| X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
|
| Hi,
|
| I was wondering if any could point me to an example or give me ideas on
how
| to dynamically create a form based on a database table? So, I would have a
| table designed to tell my application to create certain textboxes, labels,
| and combo boxes? Any ideas would be appreciated.
|
| Thanks
|
|
|

Nov 15 '05 #3

Hi Jason,

I think you can handle in the Form's Load event.
In this event, you can open the database and retrieve all the information
from the table.
Then you can dynamic construct controls and set their property correctly.
At last, use Form.Controls.A dd() method to add them into the form.

If you have any unclear, please feel free to tell me.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: "Jason" <no****@hotmail .com>
| Subject: Help Please
| Date: Fri, 17 Oct 2003 17:30:56 -0600
| Lines: 10
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <uK************ **@TK2MSFTNGP11 .phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
| NNTP-Posting-Host: 64.207.45.37
| Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP11.phx.g bl
| Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1922 42
| X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
|
| Hi,
|
| I was wondering if any could point me to an example or give me ideas on
how
| to dynamically create a form based on a database table? So, I would have a
| table designed to tell my application to create certain textboxes, labels,
| and combo boxes? Any ideas would be appreciated.
|
| Thanks
|
|
|

Nov 15 '05 #4
Thanks for your post. I understand on where to create
the controls however I am more interested in on how to
use a database to accomplish this. For instance how do I
determine the type of control to create and so on.

Thanks

-----Original Message-----

Hi Jason,

I think you can handle in the Form's Load event.
In this event, you can open the database and retrieve all the informationfrom the table.
Then you can dynamic construct controls and set their property correctly.At last, use Form.Controls.A dd() method to add them into the form.
If you have any unclear, please feel free to tell me.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
| From: "Jason" <no****@hotmail .com>
| Subject: Help Please
| Date: Fri, 17 Oct 2003 17:30:56 -0600
| Lines: 10
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165| Message-ID: <uK************ **@TK2MSFTNGP11 .phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
| NNTP-Posting-Host: 64.207.45.37
| Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl! TK2MSFTNGP11.ph x.gbl| Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1922 42| X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
|
| Hi,
|
| I was wondering if any could point me to an example or give me ideas onhow
| to dynamically create a form based on a database table? So, I would have a| table designed to tell my application to create certain textboxes, labels,| and combo boxes? Any ideas would be appreciated.
|
| Thanks
|
|
|

.

Nov 15 '05 #5
Jason wrote:
Thanks for your post. I understand on where to create
the controls however I am more interested in on how to
use a database to accomplish this. For instance how do I
determine the type of control to create and so on.

Thanks
-----Original Message-----

Hi Jason,

I think you can handle in the Form's Load event.
In this event, you can open the database and retrieve


all the information
from the table.

Then you can dynamic construct controls and set their


property correctly.
At last, use Form.Controls.A dd() method to add them into


the form.
If you have any unclear, please feel free to tell me.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and


confers no rights.
--------------------
| From: "Jason" <no****@hotmail .com>
| Subject: Help Please
| Date: Fri, 17 Oct 2003 17:30:56 -0600
| Lines: 10
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE


V6.00.2800.1165
| Message-ID: <uK************ **@TK2MSFTNGP11 .phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
| NNTP-Posting-Host: 64.207.45.37
| Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!


TK2MSFTNGP11.ph x.gbl
| Xref: cpmsftngxa06.ph x.gbl


microsoft.publi c.dotnet.langua ges.csharp:1922 42
| X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
|
| Hi,
|
| I was wondering if any could point me to an example or


give me ideas on
how
| to dynamically create a form based on a database


table? So, I would have a
| table designed to tell my application to create


certain textboxes, labels,
| and combo boxes? Any ideas would be appreciated.
|
| Thanks
|
|
|

.

A pattern that comes to my mind is as follows. Depending on how easy or
hard you want the solution to be, you can customize this..

1. You need the actual table that stores data.
2. You need a *meta* table that basically describes the UI for that table.
In order to implement that meta table,
a, you basically will have one column as the table name,
b, column name,
c, display name, [label]
d, next column would be the type of the data that can be accepted by
the UI for this,
e, next couple of columns can indicate the min and max values
f, if, the column is a foreign key to some other table, the relation is
described in another column. [this will create a combo]. otherwise a
text box.
With this, you can probably develop any UI you want by calling this
table to figure out the layout. Of course, you can probably figure out
most of these by just querying the SQL provider. That is something you
can investigate.

Otherwise,
you might want to look into some sort of serialization mechanism for
forms [i.e. provide some sort of tags against each control on the UI and
serialize the whole thing to a table and when you are about to display
de-serialze that and bring the data back as needed]..

Can you see me waving my hands furiously.. :)

You might want to investigate some of the patterns for this such as
1. Factory (for generating UI controls)
2. Facade (to wrap this subsystem somewhere)
3. ...

--
Girish Bharadwaj

Nov 15 '05 #6
Thanks for the reply, it gives a good start. I have another question
regarding to the meta table and column which describes the type of control
to build. I would really like to eliminate in code a huge case statement
examining the column string value. Is there a way to get around this?
Also, I have redesigned the app with having a main form with multiple
groupboxes which will be created and shown based on user input. I would
have thought about serializing the form however with redesign is it possible
to serialize the groupboxes?

Thanks

"Girish Bharadwaj" <girishb@nowher e> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Jason wrote:
Thanks for your post. I understand on where to create
the controls however I am more interested in on how to
use a database to accomplish this. For instance how do I
determine the type of control to create and so on.

Thanks
-----Original Message-----

Hi Jason,

I think you can handle in the Form's Load event.
In this event, you can open the database and retrieve


all the information
from the table.

Then you can dynamic construct controls and set their


property correctly.
At last, use Form.Controls.A dd() method to add them into


the form.
If you have any unclear, please feel free to tell me.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and


confers no rights.
--------------------
| From: "Jason" <no****@hotmail .com>
| Subject: Help Please
| Date: Fri, 17 Oct 2003 17:30:56 -0600
| Lines: 10
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE


V6.00.2800.1165
| Message-ID: <uK************ **@TK2MSFTNGP11 .phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
| NNTP-Posting-Host: 64.207.45.37
| Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!


TK2MSFTNGP11.ph x.gbl
| Xref: cpmsftngxa06.ph x.gbl


microsoft.publi c.dotnet.langua ges.csharp:1922 42
| X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
|
| Hi,
|
| I was wondering if any could point me to an example or


give me ideas on
how
| to dynamically create a form based on a database


table? So, I would have a
| table designed to tell my application to create


certain textboxes, labels,
| and combo boxes? Any ideas would be appreciated.
|
| Thanks
|
|
|

.

A pattern that comes to my mind is as follows. Depending on how easy or
hard you want the solution to be, you can customize this..

1. You need the actual table that stores data.
2. You need a *meta* table that basically describes the UI for that table.
In order to implement that meta table,
a, you basically will have one column as the table name,
b, column name,
c, display name, [label]
d, next column would be the type of the data that can be accepted by
the UI for this,
e, next couple of columns can indicate the min and max values
f, if, the column is a foreign key to some other table, the relation is
described in another column. [this will create a combo]. otherwise a
text box.
With this, you can probably develop any UI you want by calling this
table to figure out the layout. Of course, you can probably figure out
most of these by just querying the SQL provider. That is something you
can investigate.

Otherwise,
you might want to look into some sort of serialization mechanism for
forms [i.e. provide some sort of tags against each control on the UI and
serialize the whole thing to a table and when you are about to display
de-serialze that and bring the data back as needed]..

Can you see me waving my hands furiously.. :)

You might want to investigate some of the patterns for this such as
1. Factory (for generating UI controls)
2. Facade (to wrap this subsystem somewhere)
3. ...

--
Girish Bharadwaj

Nov 15 '05 #7
One way to do that would be just using the "type" of the control as the
marker.
You should be able to deduce most of the stuff from the datatype / foreign
key relations..
Of course, if you are going to have complicated UI, this might get a little
hairy. i.e. If you have tree structures that you want to represent here.,
that might become hard. But for simple UI, you can probably deduce from the
data type / foreign key ..

"Mike" <no****@hotmail .com> wrote in message
news:%2******** **********@TK2M SFTNGP12.phx.gb l...
Thanks for the reply, it gives a good start. I have another question
regarding to the meta table and column which describes the type of control
to build. I would really like to eliminate in code a huge case statement
examining the column string value. Is there a way to get around this?
Also, I have redesigned the app with having a main form with multiple
groupboxes which will be created and shown based on user input. I would
have thought about serializing the form however with redesign is it possible to serialize the groupboxes?

Thanks

<snip/>
Nov 15 '05 #8

Hi Mike,

Yes, just as girish suggest, you can store the type of the control.
When contruct, you can use GetType and Activator.Creat eInstance to dynamic
create it.

For your groupbox issue, I think you may design a new table which contains
all the controls in the group box, and add a relation between this table
and the groupbox control. Then you can contruct the structure of the form.

Hope this helps,

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: "Mike" <no****@hotmail .com>
| References: <uK************ **@TK2MSFTNGP11 .phx.gbl>
<TA************ **@cpmsftngxa06 .phx.gbl>
<01************ *************** *@phx.gbl>
<#G************ **@tk2msftngp13 .phx.gbl>
| Subject: Re: Help Please
| Date: Mon, 20 Oct 2003 15:22:35 -0600
| Lines: 143
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <#U************ **@TK2MSFTNGP12 .phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
| NNTP-Posting-Host: 64.207.45.37
| Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP12.phx.g bl
| Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1926 90
| X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
|
| Thanks for the reply, it gives a good start. I have another question
| regarding to the meta table and column which describes the type of control
| to build. I would really like to eliminate in code a huge case statement
| examining the column string value. Is there a way to get around this?
| Also, I have redesigned the app with having a main form with multiple
| groupboxes which will be created and shown based on user input. I would
| have thought about serializing the form however with redesign is it
possible
| to serialize the groupboxes?
|
| Thanks
|
| "Girish Bharadwaj" <girishb@nowher e> wrote in message
| news:%2******** ********@tk2msf tngp13.phx.gbl. ..
| > Jason wrote:
| >
| > > Thanks for your post. I understand on where to create
| > > the controls however I am more interested in on how to
| > > use a database to accomplish this. For instance how do I
| > > determine the type of control to create and so on.
| > >
| > > Thanks
| > >
| > >
| > >
| > >>-----Original Message-----
| > >>
| > >>Hi Jason,
| > >>
| > >>I think you can handle in the Form's Load event.
| > >>In this event, you can open the database and retrieve
| > >
| > > all the information
| > >>from the table.
| > >
| > >>Then you can dynamic construct controls and set their
| > >
| > > property correctly.
| > >
| > >>At last, use Form.Controls.A dd() method to add them into
| > >
| > > the form.
| > >
| > >>If you have any unclear, please feel free to tell me.
| > >>
| > >>Best regards,
| > >>Jeffrey Tan
| > >>Microsoft Online Partner Support
| > >>Get Secure! - www.microsoft.com/security
| > >>This posting is provided "as is" with no warranties and
| > >
| > > confers no rights.
| > >
| > >>--------------------
| > >>| From: "Jason" <no****@hotmail .com>
| > >>| Subject: Help Please
| > >>| Date: Fri, 17 Oct 2003 17:30:56 -0600
| > >>| Lines: 10
| > >>| X-Priority: 3
| > >>| X-MSMail-Priority: Normal
| > >>| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > >>| X-MimeOLE: Produced By Microsoft MimeOLE
| > >
| > > V6.00.2800.1165
| > >
| > >>| Message-ID: <uK************ **@TK2MSFTNGP11 .phx.gbl>
| > >>| Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
| > >>| NNTP-Posting-Host: 64.207.45.37
| > >>| Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!
| > >
| > > TK2MSFTNGP11.ph x.gbl
| > >
| > >>| Xref: cpmsftngxa06.ph x.gbl
| > >
| > > microsoft.publi c.dotnet.langua ges.csharp:1922 42
| > >
| > >>| X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
| > >>|
| > >>| Hi,
| > >>|
| > >>| I was wondering if any could point me to an example or
| > >
| > > give me ideas on
| > >
| > >>how
| > >>| to dynamically create a form based on a database
| > >
| > > table? So, I would have a
| > >
| > >>| table designed to tell my application to create
| > >
| > > certain textboxes, labels,
| > >
| > >>| and combo boxes? Any ideas would be appreciated.
| > >>|
| > >>| Thanks
| > >>|
| > >>|
| > >>|
| > >>
| > >>.
| > >>
| >
| >
| > A pattern that comes to my mind is as follows. Depending on how easy or
| > hard you want the solution to be, you can customize this..
| >
| > 1. You need the actual table that stores data.
| > 2. You need a *meta* table that basically describes the UI for that
table.
| > In order to implement that meta table,
| > a, you basically will have one column as the table name,
| > b, column name,
| > c, display name, [label]
| > d, next column would be the type of the data that can be accepted by
| > the UI for this,
| > e, next couple of columns can indicate the min and max values
| > f, if, the column is a foreign key to some other table, the relation is
| > described in another column. [this will create a combo]. otherwise a
| > text box.
| >
| >
| > With this, you can probably develop any UI you want by calling this
| > table to figure out the layout. Of course, you can probably figure out
| > most of these by just querying the SQL provider. That is something you
| > can investigate.
| >
| > Otherwise,
| > you might want to look into some sort of serialization mechanism for
| > forms [i.e. provide some sort of tags against each control on the UI and
| > serialize the whole thing to a table and when you are about to display
| > de-serialze that and bring the data back as needed]..
| >
| > Can you see me waving my hands furiously.. :)
| >
| > You might want to investigate some of the patterns for this such as
| > 1. Factory (for generating UI controls)
| > 2. Facade (to wrap this subsystem somewhere)
| > 3. ...
| >
| > --
| > Girish Bharadwaj
| >
|
|
|

Nov 15 '05 #9
Dan
Thanks for the reply. So, when you state save the type of control - do you
mean the string representation of the type of control?

Thanks

""Jeffrey Tan[MSFT]"" <v-*****@online.mi crosoft.com> wrote in message
news:B7******** ******@cpmsftng xa06.phx.gbl...

Hi Mike,

Yes, just as girish suggest, you can store the type of the control.
When contruct, you can use GetType and Activator.Creat eInstance to dynamic
create it.

For your groupbox issue, I think you may design a new table which contains
all the controls in the group box, and add a relation between this table
and the groupbox control. Then you can contruct the structure of the form.

Hope this helps,

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: "Mike" <no****@hotmail .com>
| References: <uK************ **@TK2MSFTNGP11 .phx.gbl>
<TA************ **@cpmsftngxa06 .phx.gbl>
<01************ *************** *@phx.gbl>
<#G************ **@tk2msftngp13 .phx.gbl>
| Subject: Re: Help Please
| Date: Mon, 20 Oct 2003 15:22:35 -0600
| Lines: 143
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <#U************ **@TK2MSFTNGP12 .phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
| NNTP-Posting-Host: 64.207.45.37
| Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP12.phx.g bl
| Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1926 90 | X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
|
| Thanks for the reply, it gives a good start. I have another question
| regarding to the meta table and column which describes the type of control | to build. I would really like to eliminate in code a huge case statement | examining the column string value. Is there a way to get around this?
| Also, I have redesigned the app with having a main form with multiple
| groupboxes which will be created and shown based on user input. I would
| have thought about serializing the form however with redesign is it
possible
| to serialize the groupboxes?
|
| Thanks
|
| "Girish Bharadwaj" <girishb@nowher e> wrote in message
| news:%2******** ********@tk2msf tngp13.phx.gbl. ..
| > Jason wrote:
| >
| > > Thanks for your post. I understand on where to create
| > > the controls however I am more interested in on how to
| > > use a database to accomplish this. For instance how do I
| > > determine the type of control to create and so on.
| > >
| > > Thanks
| > >
| > >
| > >
| > >>-----Original Message-----
| > >>
| > >>Hi Jason,
| > >>
| > >>I think you can handle in the Form's Load event.
| > >>In this event, you can open the database and retrieve
| > >
| > > all the information
| > >>from the table.
| > >
| > >>Then you can dynamic construct controls and set their
| > >
| > > property correctly.
| > >
| > >>At last, use Form.Controls.A dd() method to add them into
| > >
| > > the form.
| > >
| > >>If you have any unclear, please feel free to tell me.
| > >>
| > >>Best regards,
| > >>Jeffrey Tan
| > >>Microsoft Online Partner Support
| > >>Get Secure! - www.microsoft.com/security
| > >>This posting is provided "as is" with no warranties and
| > >
| > > confers no rights.
| > >
| > >>--------------------
| > >>| From: "Jason" <no****@hotmail .com>
| > >>| Subject: Help Please
| > >>| Date: Fri, 17 Oct 2003 17:30:56 -0600
| > >>| Lines: 10
| > >>| X-Priority: 3
| > >>| X-MSMail-Priority: Normal
| > >>| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > >>| X-MimeOLE: Produced By Microsoft MimeOLE
| > >
| > > V6.00.2800.1165
| > >
| > >>| Message-ID: <uK************ **@TK2MSFTNGP11 .phx.gbl>
| > >>| Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
| > >>| NNTP-Posting-Host: 64.207.45.37
| > >>| Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!
| > >
| > > TK2MSFTNGP11.ph x.gbl
| > >
| > >>| Xref: cpmsftngxa06.ph x.gbl
| > >
| > > microsoft.publi c.dotnet.langua ges.csharp:1922 42
| > >
| > >>| X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
| > >>|
| > >>| Hi,
| > >>|
| > >>| I was wondering if any could point me to an example or
| > >
| > > give me ideas on
| > >
| > >>how
| > >>| to dynamically create a form based on a database
| > >
| > > table? So, I would have a
| > >
| > >>| table designed to tell my application to create
| > >
| > > certain textboxes, labels,
| > >
| > >>| and combo boxes? Any ideas would be appreciated.
| > >>|
| > >>| Thanks
| > >>|
| > >>|
| > >>|
| > >>
| > >>.
| > >>
| >
| >
| > A pattern that comes to my mind is as follows. Depending on how easy or | > hard you want the solution to be, you can customize this..
| >
| > 1. You need the actual table that stores data.
| > 2. You need a *meta* table that basically describes the UI for that
table.
| > In order to implement that meta table,
| > a, you basically will have one column as the table name,
| > b, column name,
| > c, display name, [label]
| > d, next column would be the type of the data that can be accepted by
| > the UI for this,
| > e, next couple of columns can indicate the min and max values
| > f, if, the column is a foreign key to some other table, the relation is | > described in another column. [this will create a combo]. otherwise a
| > text box.
| >
| >
| > With this, you can probably develop any UI you want by calling this
| > table to figure out the layout. Of course, you can probably figure out
| > most of these by just querying the SQL provider. That is something you
| > can investigate.
| >
| > Otherwise,
| > you might want to look into some sort of serialization mechanism for
| > forms [i.e. provide some sort of tags against each control on the UI and | > serialize the whole thing to a table and when you are about to display
| > de-serialze that and bring the data back as needed]..
| >
| > Can you see me waving my hands furiously.. :)
| >
| > You might want to investigate some of the patterns for this such as
| > 1. Factory (for generating UI controls)
| > 2. Facade (to wrap this subsystem somewhere)
| > 3. ...
| >
| > --
| > Girish Bharadwaj
| >
|
|
|

Nov 15 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
3489
by: duikboot | last post by:
Hi all, I'm trying to export a view tables from a Oracle database to a Mysql database. I create insert statements (they look alright), but it all goes wrong when I try to execute them in Mysql, because the dates must have quotes on each side. I just don't know how make the dates right. Well I'll just show you the code and some insert statements it generates. Could anyone please help me?
1
406
by: LilleSkutt | last post by:
I am trying to create and instantiate a class into a created domain, so that I can unload the domain and replace the class (assembly .dll) while the main application is running, but I can't get it to work for some reason. Here is the code: ' Create an appdomain Try Dim setup As AppDomainSetup = New AppDomainSetup setup.ApplicationBase = "C:\test" setup.PrivateBinPath = AppDomain.CurrentDomain.BaseDirectory setup.ApplicationName =...
14
2160
by: TrvlOrm | last post by:
OK. After much playing around, I managed to get my frame page this far.. see code below. BUT...there are still errors with it, and what I would like to have happened is this: 1) On the Left Frame (File LeftEx8_2.html) a series of buttons, which when clicked prompt the user to enter information for background color, text color, link color, title and some text.
3
3419
by: radioman | last post by:
Hi all, I would appreciate some help please. I just need pointing in the right direction as I am at a loss. Basically I have a form (frmAddMaster) which displays two subforms "Master Stock subform" and "Client Stock Template subform". Each subform contains the following fields "Product ID,Product Description and Size". What I am trying to do is to select rows from the "Master Stock subform" and copy them to "Client Stock Template...
1
3439
by: Chua Wen Ching | last post by:
Hi there, I have some problems when reading XML file. 1. First this, is what i did, cause i can't seem to read "sub elements or tags" values, so i place those values into attributes like this. Before: ----------
4
2277
by: steroche | last post by:
I would REALLY appreciate help please please please! Im sure it is probably blindingly obvious to most of you but I am totally in the dark here!I am lost - i thought i had finally figured out this dataSet updating lark when i realised that i think i am right back at square 1!!! Here's my scenario - i have a SQLDB and i retrieve all my data from that into a dataset and display this to a datagrid(WebForm). I have got this grid sorted and...
28
10262
by: Tim_Mac | last post by:
hi, i'm new to .net 2.0, and am just starting to get to grips with the gridview. my page has autoEventWireUp set to true, which i gather is supposed to figure out which handlers to invoke when appropriate based on your method names . the GridView has OnRowCommand="GridView1_RowCommand" in the aspx. my problem is that the RowCommand event is firing twice (95% of the time) on the page. the other 5% it only fires once. there's no
2
2592
by: Richard | last post by:
Help please. I am trying to autofill a form text field from a select-box lookup. I have no problem doing this if the select-box is part of the form but because there are 5 possible select boxes for them to choose from and because of the very large number of options in each select box, to save form loading time, I want to put the look-up select boxes on separate (pop-up) pages. (I prefer them not to be hidden divs on the same page) ...
0
2754
by: uno7031 | last post by:
Help Please!!! Adding 5 Days to another Date in an access query Good Morning, Help please…. I am new to access and trying to write a query that will add 5 days between a RecDate and a DLPayDate I created the query in design view of access. Current Query: SELECT PaymentCalculator2.ID, PaymentCalculator2.RecDate, DateAdd("w",5+1,) AS DLPayDate, DateAdd("w",5,) AS DLPayDate2 FROM PaymentCalculator2 WHERE...
0
8659
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9240
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8996
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6585
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5920
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4417
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4674
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2055
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.