Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

nisc wwwxxx, wwwxxx0cm, should producers of software-based services, such as atms, be held liable for economic injuries suffered when their systems fail?, wwwxxx0cm, www.webdp.net, Event 9 IIS log failed to write entry, wwwxxx jeffs, Catastrophic failure Unexpected method call sequence. 0x8000ffff (-2147418113)., ksh lock a file, [unixODBC][Driver Manager]Driver's SQLAllocHandle on SQL_HANDLE_DBC failed

Links

XODOX
Impressum

#1: Data Dictionary App - Yikes!

Posted on 2008-01-30 18:31:03 by Rbrt

I am writing an application that is data dictionary driven - users will have
the ability to create tables and add fields to those tables, and other users
will be able to do data entry into these tables, view them, etc...

The problem is in writing the code for data entry and display. I have tried
FormView, GridView, Generic Repeater controls, etc. but have not been able to
find a way to dynamically add the necessary textboxes, what have you, when
the structure of the table and fields is not known beforehand. Everything I
have seen about these controls tells me that you have to explicitly define
controls at design time by specifying each object in a DIM command (VB).

This used to be very easy using Control Arrays but if I understand
correctly, control arrays are not supported in ASP.NET.

Any suggestions?

Report this message

#2: RE: Data Dictionary App - Yikes!

Posted on 2008-01-30 20:45:01 by brucebarker

all controls in asp.net are dynamic and created at runtime. its trivial to
add them. in asp.net all container controls have a Controls collection you
can add new control to:


TextBox t = new TextBox();
t.Id = "text1";
myContainter.Controls.Add(t);

you might also want to look at the asp.net MVC toolkit which is a better
framework for this type of application. also look at iron python or iron ruby
which are also much better languages for this type of application then vb.net
or c#. The new dynamic binding controls were designed with these languages in
mind.

-- bruce (sqlwork.com)


"Rbrt" wrote:

> I am writing an application that is data dictionary driven - users will have
> the ability to create tables and add fields to those tables, and other users
> will be able to do data entry into these tables, view them, etc...
>
> The problem is in writing the code for data entry and display. I have tried
> FormView, GridView, Generic Repeater controls, etc. but have not been able to
> find a way to dynamically add the necessary textboxes, what have you, when
> the structure of the table and fields is not known beforehand. Everything I
> have seen about these controls tells me that you have to explicitly define
> controls at design time by specifying each object in a DIM command (VB).
>
> This used to be very easy using Control Arrays but if I understand
> correctly, control arrays are not supported in ASP.NET.
>
> Any suggestions?

Report this message

#3: RE: Data Dictionary App - Yikes!

Posted on 2008-01-30 21:18:01 by Rbrt

Won't work. I want to create a Form to display the data from a database that
I do not know the structure of. So I do a "SELECT * from " & strTblName...

....and I get a datatable. Now I find out not only what the table's data
might be, but also its fields....

It's time to present that data ...

so...

"Textbox t = new textbox" is not going to help because I cannot say what t
is in runtime, which is when I discover what the table fields might be...

I need to be able to say at runtime...

Textbox (datatable.fields(x).name) = new TextBox()...

or ...

Textbox(x) = new textbox

or something similar....

"bruce barker" wrote:

> all controls in asp.net are dynamic and created at runtime. its trivial to
> add them. in asp.net all container controls have a Controls collection you
> can add new control to:
>
>
> TextBox t = new TextBox();
> t.Id = "text1";
> myContainter.Controls.Add(t);
>
> you might also want to look at the asp.net MVC toolkit which is a better
> framework for this type of application. also look at iron python or iron ruby
> which are also much better languages for this type of application then vb.net
> or c#. The new dynamic binding controls were designed with these languages in
> mind.
>
> -- bruce (sqlwork.com)
>
>
> "Rbrt" wrote:
>
> > I am writing an application that is data dictionary driven - users will have
> > the ability to create tables and add fields to those tables, and other users
> > will be able to do data entry into these tables, view them, etc...
> >
> > The problem is in writing the code for data entry and display. I have tried
> > FormView, GridView, Generic Repeater controls, etc. but have not been able to
> > find a way to dynamically add the necessary textboxes, what have you, when
> > the structure of the table and fields is not known beforehand. Everything I
> > have seen about these controls tells me that you have to explicitly define
> > controls at design time by specifying each object in a DIM command (VB).
> >
> > This used to be very easy using Control Arrays but if I understand
> > correctly, control arrays are not supported in ASP.NET.
> >
> > Any suggestions?

Report this message

#4: RE: Data Dictionary App - Yikes!

Posted on 2008-01-30 21:47:00 by pbromberg

I don't see why you cannot do this. You just need to get the syntax correct.
For example (pseudocode, untested):

foreach( DataRow row in myDataTable.Rows)
{
foreach DataColumn col in myDataTable.Columns)
{
TextBox t = new TextBox();
t.ID = col.ColumnName;
t.Text = (string)row[col.ColumnName];
// add "t" to container control here, handle positioning
}


}
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
MetaFinder: http://www.blogmetafinder.com


"Rbrt" wrote:

> Won't work. I want to create a Form to display the data from a database that
> I do not know the structure of. So I do a "SELECT * from " & strTblName...
>
> ...and I get a datatable. Now I find out not only what the table's data
> might be, but also its fields....
>
> It's time to present that data ...
>
> so...
>
> "Textbox t = new textbox" is not going to help because I cannot say what t
> is in runtime, which is when I discover what the table fields might be...
>
> I need to be able to say at runtime...
>
> Textbox (datatable.fields(x).name) = new TextBox()...
>
> or ...
>
> Textbox(x) = new textbox
>
> or something similar....
>
> "bruce barker" wrote:
>
> > all controls in asp.net are dynamic and created at runtime. its trivial to
> > add them. in asp.net all container controls have a Controls collection you
> > can add new control to:
> >
> >
> > TextBox t = new TextBox();
> > t.Id = "text1";
> > myContainter.Controls.Add(t);
> >
> > you might also want to look at the asp.net MVC toolkit which is a better
> > framework for this type of application. also look at iron python or iron ruby
> > which are also much better languages for this type of application then vb.net
> > or c#. The new dynamic binding controls were designed with these languages in
> > mind.
> >
> > -- bruce (sqlwork.com)
> >
> >
> > "Rbrt" wrote:
> >
> > > I am writing an application that is data dictionary driven - users will have
> > > the ability to create tables and add fields to those tables, and other users
> > > will be able to do data entry into these tables, view them, etc...
> > >
> > > The problem is in writing the code for data entry and display. I have tried
> > > FormView, GridView, Generic Repeater controls, etc. but have not been able to
> > > find a way to dynamically add the necessary textboxes, what have you, when
> > > the structure of the table and fields is not known beforehand. Everything I
> > > have seen about these controls tells me that you have to explicitly define
> > > controls at design time by specifying each object in a DIM command (VB).
> > >
> > > This used to be very easy using Control Arrays but if I understand
> > > correctly, control arrays are not supported in ASP.NET.
> > >
> > > Any suggestions?

Report this message

#5: RE: Data Dictionary App - Yikes!

Posted on 2008-01-30 22:05:04 by Rbrt

The problem comes when you want to add the control to a PlaceHolder. You can
have only one TextBox t, right?

"Peter Bromberg [C# MVP]" wrote:

> I don't see why you cannot do this. You just need to get the syntax correct.
> For example (pseudocode, untested):
>
> foreach( DataRow row in myDataTable.Rows)
> {
> foreach DataColumn col in myDataTable.Columns)
> {
> TextBox t = new TextBox();
> t.ID = col.ColumnName;
> t.Text = (string)row[col.ColumnName];
> // add "t" to container control here, handle positioning
> }
>
>
> }
> -- Peter
> Site: http://www.eggheadcafe.com
> UnBlog: http://petesbloggerama.blogspot.com
> MetaFinder: http://www.blogmetafinder.com
>
>
> "Rbrt" wrote:
>
> > Won't work. I want to create a Form to display the data from a database that
> > I do not know the structure of. So I do a "SELECT * from " & strTblName...
> >
> > ...and I get a datatable. Now I find out not only what the table's data
> > might be, but also its fields....
> >
> > It's time to present that data ...
> >
> > so...
> >
> > "Textbox t = new textbox" is not going to help because I cannot say what t
> > is in runtime, which is when I discover what the table fields might be...
> >
> > I need to be able to say at runtime...
> >
> > Textbox (datatable.fields(x).name) = new TextBox()...
> >
> > or ...
> >
> > Textbox(x) = new textbox
> >
> > or something similar....
> >
> > "bruce barker" wrote:
> >
> > > all controls in asp.net are dynamic and created at runtime. its trivial to
> > > add them. in asp.net all container controls have a Controls collection you
> > > can add new control to:
> > >
> > >
> > > TextBox t = new TextBox();
> > > t.Id = "text1";
> > > myContainter.Controls.Add(t);
> > >
> > > you might also want to look at the asp.net MVC toolkit which is a better
> > > framework for this type of application. also look at iron python or iron ruby
> > > which are also much better languages for this type of application then vb.net
> > > or c#. The new dynamic binding controls were designed with these languages in
> > > mind.
> > >
> > > -- bruce (sqlwork.com)
> > >
> > >
> > > "Rbrt" wrote:
> > >
> > > > I am writing an application that is data dictionary driven - users will have
> > > > the ability to create tables and add fields to those tables, and other users
> > > > will be able to do data entry into these tables, view them, etc...
> > > >
> > > > The problem is in writing the code for data entry and display. I have tried
> > > > FormView, GridView, Generic Repeater controls, etc. but have not been able to
> > > > find a way to dynamically add the necessary textboxes, what have you, when
> > > > the structure of the table and fields is not known beforehand. Everything I
> > > > have seen about these controls tells me that you have to explicitly define
> > > > controls at design time by specifying each object in a DIM command (VB).
> > > >
> > > > This used to be very easy using Control Arrays but if I understand
> > > > correctly, control arrays are not supported in ASP.NET.
> > > >
> > > > Any suggestions?

Report this message

#6: RE: Data Dictionary App - Yikes!

Posted on 2008-01-31 12:36:00 by Rbrt

Answering my own question... I've found this MSDN article which might be
useful and I am trying it out now...

http://msdn2.microsoft.com/en-us/library/aa289500(VS.71).asp x

"Rbrt" wrote:

> I am writing an application that is data dictionary driven - users will have
> the ability to create tables and add fields to those tables, and other users
> will be able to do data entry into these tables, view them, etc...
>
> The problem is in writing the code for data entry and display. I have tried
> FormView, GridView, Generic Repeater controls, etc. but have not been able to
> find a way to dynamically add the necessary textboxes, what have you, when
> the structure of the table and fields is not known beforehand. Everything I
> have seen about these controls tells me that you have to explicitly define
> controls at design time by specifying each object in a DIM command (VB).
>
> This used to be very easy using Control Arrays but if I understand
> correctly, control arrays are not supported in ASP.NET.
>
> Any suggestions?

Report this message