By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,685 Members | 1,896 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,685 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
5 Replies


P: n/a
Hi Mike,

Very easy (as you know it)

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

:-)

Cor
Oct 17 '07 #2

P: n/a
"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

P: n/a
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

P: n/a
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

P: n/a
"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 discussion thread is closed

Replies have been disabled for this discussion.