How to retrieve database schema for use in IBindableTemplate.ExctractValues

  • Thread starter Thread starter fuchs.markus
  • Start date Start date
F

fuchs.markus

Hello all,
I'm currently writing on a templated databound control.
But for the control to work correctly I need to know the Datatype of
the columns to which values in the template are bound.
An example:

markup in the template:
<asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("BirthDate")
%>'></asp:TextBox>

Now, how can i determine if the column BirthDate is a string or a
number or a date, etc..

Thanks in advance
Markus Fuchs

(Sorry for my English, i'm not native)
 
If this is SQL server, you can run an sp_help on the table. If this can be
multiple types of database, I would consider using Interop with SQL DMO. With
the 2.0 Framework and SQL Server 2005, you also have SMO as an option (future
thoughts).

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 
You can do what the GridView does to build its columns. It, in essence, gets
the first row then uses reflection to interogate the row for its properties.
It does this in CreateChildControls. Where are you looking to do this in
your code? Use reflector and check out CreateAutoGeneratedColumns on the
GridView.

-Brock
DevelopMentor
http://staff.develop.com/ballen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top