PC Review


Reply
Thread Tools Rate Thread

Data column length probem

 
 
Gilgamesh
Guest
Posts: n/a
 
      22nd Jul 2006
I'm retrieving a data column from SQL Server 2000 which has the type Varchar
with length set to 10. The MaxLength method of DataColumn object returns -1
instead of the correct size which is 10. Does anybody have an idea why C#
doesn't read the correct length?
Here is the code

foreach (DataColumn _dataColumn in importDataSet.Tables[0].Columns)

{

if (_dataColumn.MaxLength < _rawFieldValue.ToString().Length)

}


Thanks,
Gilgamesh


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to sort column data regardless of col length JBW Microsoft Excel Worksheet Functions 2 26th Nov 2007 10:40 AM
Width/Length of Data Column schaapiee Microsoft Dot NET 1 26th Mar 2007 08:03 PM
Width/Length of Data Column schaapiee Microsoft VB .NET 2 26th Mar 2007 08:02 PM
How to know length (data width) of column from VB.Net Hardik Shah Microsoft ADO .NET 1 14th Feb 2006 08:58 AM
Probem: No size set for variable length data type: String, using OracleDataAdapter Benny Microsoft ADO .NET 4 21st Dec 2005 05:24 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:18 AM.