Size of datacolumn

  • Thread starter Thread starter Christian Dokman
  • Start date Start date
C

Christian Dokman

Hello,

I'd like to fill a dataset column with a product-description. Sometimes
the size of the description-text is longer than 255 characters. At that
length, the dataset automatically cuts off the text. Does anyone know
how I can use more than 255 characters in a dataset column?

Greetings,
Christian.
 
I have tried setting that property already, but that doesn't work. Any
other suggestion?
 
Hi there,

Thanks for replying!

I use a Microsoft Access query to fill the dataset that is bound to the
datagrid. The query shows the product description just fine (more than
255 characters). When I use the fill method from a dataadapter and fill
the dataset, the dataset only shows the first 255 characters. I have
tried to create a dataset with datacolumns first and set the MaxLenght
property to 1000 and than fill the dataset, but that doesn't seem to
have any effect. Also setting the MaxLenght after filling the dataset
has no effect. Any idea how to solve this?

Greetings,
Christian Dokman
 
Hi Christian,

What type is the Access column?
How does select look like?
How does connection string look like?
 
Hello,

I have a table with products. The table contains several columns. A
column with the product ID (datatype 'long'), a column with the product
name (datatype 'text') and a column with the product description (data
type 'memo').

My query shows the product id column and combines the product name and
description in 1 column as follows:

Product: txtName & ": " & memDescription

The query shows all data correct.

In ASP.NET I connect to the database (the connectionstring works fine):

dim conn as new oledb.oledbconnection(CONNECTIONSTRING)
dim da as new oledb.oledbdataadapter("SELECT * FROM qryProducts", conn)
dim ds as new dataset

da.fill(ds)

The 'Product' column in the query now shows all characters, but the
dataset only contains the first 255 characters.

Greetings,
Christian.
 
Hi Christian,

You are correct. It really doesn't return more than 255 chars - actually it
returns garbage on position > 255.
It is probably an issue with jet oledb provider when concatenating text and
memo fields.
As a workaround try embedding your concatenation (inside query) into CStr()
or select fields separately.
 
Hi there,

The Cstr() around it didn't work, so in the query I have devided the
productdescription column into 22 other columns (all of 250 characters,
because the product description can be up to 5250 characters!). In
ASP.NET I paste all columns into the one datasetcolumn with the
productdescription and now the datagrid shows the correct description!

This is indeed a workaround, but it works!

Thanks for all your help!

Greetings,
Christian
 
Back
Top