Hi guys I need your help once again. I can update a record from excel through datagrid but I've encounter a problem where instead updating in number/percentage format(I have columns in number format and in percentage format) it updates in General Format. Example:

col1  col2    col3
abc   123.00  100% -------> Both 0 at first before updating
def   456     1 ----------> col2 and col3 doesn't have value. supposed to be 456.00 & 100%

It usually happens if the record I'm updating has no value on col2 and col3 even though cells in col2 and col3 is in number and percentage format respectively. I use the OLE DB Update Method in updating my records in Excel.

Recommended Answers

All 2 Replies

Is it in an Excel sheet that you want those number formats to be like that?

Yes it is an Excel sheet. In the datagrid it shows my desired format but in Excel it doesn't, I even format a whole column to be in numbers and the other in percentage but it changes it back to General while the other cells doesn't. I'd like to do it programmatically as much as possible instead of doing it manually

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.