473,387 Members | 1,548 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to retrieve database schema for use in IBindableTemplate.ExctractValues

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)

Nov 19 '05 #1
3 933
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!
***************************
"fu**********@gmail.com" wrote:
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)

Nov 19 '05 #2
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
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)


Nov 19 '05 #3
Hi Allen,

it works perfectly.

Thank you very much.

Markus

Nov 19 '05 #4

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

Similar topics

2
by: Randy Jackson | last post by:
First of all, I apologize in advance if this is covered somewhere in a FAQ. I did a Google search, but really couldn't find anything. I'm having a problem with a simple select query. I've got...
0
by: Mike | last post by:
Hello, I'm trying to understand how to map hierarchical XML data to relational database tables, but I seem to be missing something. I'm not a database expert, but I know the basics. XML seems...
0
by: Dimitris Katsikas | last post by:
Hi everybody, I am trying to find a way to export automatically an entire database schema into an .xsd A graphical way is to drag & drop the tables from Server Connection into an empty .xsd...
11
by: jw56578 | last post by:
what is a common method, if any, to retrieve stored query information from Access. MDAC does not support OleDbSchemaGuid.Procedure_Columns. I need stored procedure name and paramter information,...
2
by: Torben Jensen | last post by:
Hi, Does anyone have experience in retrieveing useraccount information like eg. name, lastname, phonenumber, adress etc from Active Directory from an asp.net application? Perhaps standard...
4
by: Ganesh Muthuvelu | last post by:
Hello, What is wrong with this template below?. I get this error: "Class 'MyEditFormTemplate' must implement 'Function ExtractValues(container As Control) As...
10
by: shsandeep | last post by:
The ETL application loaded around 3000 rows in 14 seconds in a Development database while it took 2 hours to load in a UAT database. UAT db is partitioned. Dev db is not partitioned. the...
5
by: Ken | last post by:
I'm trying to run a loop to capture column property information from a table in my datasource. Can anybody see where this is going wrong? Dim tbl As New DataTable Dim col As DataColumn Dim x...
8
by: situ | last post by:
Hello all, i have Database1 and database2, is it possible to make database connection to database2 by running stored procedure on database1. Thanks and Regards Situ
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.