How to retrieve database schema for use in IBindableTemplate.ExctractValues

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)
 
G

Guest

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!
***************************
 
B

Brock Allen

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.
 

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

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top