473,378 Members | 1,500 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,378 software developers and data experts.

setting maxlength

sql
Hi all,
I would like to set MaxLength property of asp.net controls on my page
based on their corresponding field length in Sql Server table. I know I can
get the TableSchema along with the record if I read the data into a DataSet.
But I don't want to store data in a DataSet because I am going to work on
only one record. So I don't want the overhead that comes with using a
DataSet. I will probably use a custom entity object and fill it using a
DataReader. I know how to do that. But now the question is what is the best
possible way to set MaxLength property of the controls on my page. I do not
want to hardcode the values in my page. Can anyone please throw some light
or provide sample code?

Thanks in advance.
Nov 21 '05 #1
1 1094
Your DataReader can also supply you with a schema table, using its
GetSchemaTable method. Each row in the table describes one column in the
data reader.

Tom Dacon
Dacon Software Consulting

"sql" <do*******@nospaml.com> wrote in message
news:#K**************@TK2MSFTNGP12.phx.gbl...
Hi all,
I would like to set MaxLength property of asp.net controls on my page
based on their corresponding field length in Sql Server table. I know I can get the TableSchema along with the record if I read the data into a DataSet. But I don't want to store data in a DataSet because I am going to work on
only one record. So I don't want the overhead that comes with using a
DataSet. I will probably use a custom entity object and fill it using a
DataReader. I know how to do that. But now the question is what is the best possible way to set MaxLength property of the controls on my page. I do not want to hardcode the values in my page. Can anyone please throw some light
or provide sample code?

Thanks in advance.

Nov 21 '05 #2

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

Similar topics

3
by: Buck Turgidson | last post by:
According to an O'Reilly PHP book I have, setting variables_order to "ES" is safer, but that one will need to create global variables, not rely on them being created. Fair enough. But why does...
2
by: sql | last post by:
Hi all, I would like to set MaxLength property of asp.net controls on my page based on their corresponding field length in Sql Server table. I know I can get the TableSchema along with the record...
2
by: dsnyder | last post by:
This HTML has a bit of Javascript at the end that puts the initial focus on the userID field. It works great on Windows2000 running IE6, but the initial focus never goes to the userID field on...
7
by: ray | last post by:
My xsd has the following element: <xs:element name="Company" minOccurs="0"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:minLength value="1" /> <xs:maxLength value="5" />...
2
by: Craig G | last post by:
how do you do it? i understand the maxlength property has no effect but is there a way around it?
4
by: SJ | last post by:
Hi all, I have come across a weird problem when attempting to automatically set the focus in a vb.net form to a checkbox control... In my form I have (on a tab page in a tab control) several...
9
by: The Confessor | last post by:
I declare the following variable in one of my structures... <VBFixedString(17)> Dim Name As String Fixed to 17 because it's written to a random-access file. Is there any way to tie the...
5
by: jose1lm | last post by:
What is supposed to happen: A user enters data into one of the FORM input selections. When the user submits the form, the onclick event is supposed to go to a function that will set another FORM...
3
by: gomzi | last post by:
hi, I am trying to set the maxlength property of a multiline textbox without much success. Could anyone tell me as to how it could be done ? thanks, gomzi.
1
by: Mel | last post by:
Anyone know how I would retrieve the MaxLength property of a column in my Access Database table? I know how to retrieve table data, for example the "Quote #" field in my example code below, but I...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.