473,406 Members | 2,312 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,406 software developers and data experts.

How do I get the width of a column using Type Datasets?

How do I get the width of a column using Type Datasets? I don't want to know
the length of the data in the column, I want to know the width of the column.
In my code, if the column width is 50 characters, but a string with 55
characters tries to insert then I get runtime error. So, I want the width of
the column so I can cut out that number of (50) characters from the string.
Oct 17 '07 #1
5 1579
Hi Mike,

Very easy (as you know it)

http://msdn2.microsoft.com/en-us/lib...th(VS.71).aspx

:-)

Cor
Oct 17 '07 #2
"Cor Ligthert [MVP]" <no************@planet.nlschrieb
Hi Mike,

Very easy (as you know it)

http://msdn2.microsoft.com/en-us/lib...th(VS.71).aspx

:-)
I thought so, too, but I've tried it and it returns -1 although it should be
50 (SQL Server, field type is nvarchar(50)). Do you know why? (Before, I
filled the dataset)
Armin

Oct 17 '07 #3
Armin,

AFAIK is only when you create the strongly dataset using the database tables
and you have set in the SQL servercolumn a limit.

Cor

Oct 17 '07 #4
Mike,

Armin let me think about your qeustion. If you databind such a column to by
instance a textbox you cannot even put in more than than length.

Cor

Oct 17 '07 #5
"Cor Ligthert[MVP]" <no************@planet.nlschrieb
Armin,

AFAIK is only when you create the strongly dataset using the
database tables and you have set in the SQL servercolumn a limit.
Hmm, I don't completely understand. The server column does have a limit.
Armin
Oct 17 '07 #6

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

Similar topics

1
by: aspnetpal | last post by:
Hi Every1, I'm getting this error. 'Cannot specify a column width on data type smalldatetime.' I'm using SQL Server & I've check the data type in the db & it's same as smalldatetime. Any...
0
by: Lalit Bhatia | last post by:
Hi, In Datagrid, while setting width of column through GridColumnStyles collection. width does not set to exact width that I am setting in my code. If I set width to 13, it is changed to 130 or...
0
by: Stuart | last post by:
Hi there Someone please put me out of my misery... I am attempting to offer a graphical view of some data in an aspx page by using the width property of some colored text boxes. The data is...
16
by: Geoff Jones | last post by:
Hi Can anybody help me with the following, hopefully simple, question? I have a table which I've connected to a dataset. I wish to add a new column to the beginning of the table and to fill...
0
by: smilla | last post by:
Hi, I'm trying to use css to set the widths of cells and tables, for multiple tables. The width of the tables is 450px, set in stylesheet. The number of columns and widths vary, but I'd...
5
by: GG | last post by:
I am trying to add a nullable datetime column to a datatable fails. I am getting exception DataSet does not support System.Nullable<>. None of these works dtSearchFromData.Columns.Add( new...
3
by: McKirahan | last post by:
I have a Web page that uses some JavaScript and CSS. I have specified a three column table with a fixed-width left and right side; the center colum expands to fill the page. Within this...
2
by: xtian | last post by:
Hi, I have been having some trouble with getting a column to be a fixed width. I have a table with 11 columns, so it doesn't all fit in a normal browser window. One of the cells has a "?" and then...
1
pradeepjain
by: pradeepjain | last post by:
I have a 3 column layout left<->content<->right<->.I made a css and html in such a manner that when there is no left sidebar the content region starts from left side and takes whole width of left on...
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: 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
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...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.