DataFormatString Help

S

Simon Harris

I have a datagrid which is populated from an Excel file via an OLEDB
connection.

The data format in the Excel file for column A is text.

The data is either a single number - e.g. 1 or a number followed by a
letter - e.g. 7D

The cells that contain a number followed by a letter never get displayed in
my datagrid - They are empty. Single numbers are AOK.

I guess I need to work on a DataFormatString code to sort this, but have not
had much luck so far. Have tried {0:G} for general, which did not help.

Any advice will be appreciated.

Regards,
Simon.
 
W

William F. Robertson, Jr.

Just for kicks Simon, change your excel file so that the first couple rows
start with a letter before the number.

See if you have the same problem. I came across this before.

bill
 
S

Simon Harris

Hi Bill,

I actually ended up adding the data into the Excel file using formulas (e.g.
="7D") which worked. Thanks for pointing me in the right direction! :)

Simon.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top