Need help,

I need to know on how can VB.net validates the format of each cell on the excel file that it opens,
for example, the first row should only be numeric, or cannot be null,
is it possible that vb.net can check it before it inserts it in the dataset or data table?
how can it be done?

thanks

Recommended Answers

All 4 Replies

As far as I know there is no validation done. Even in Excel things are lax. For example, if you set the format for a cell in Excel to "currency", Excel will not prevent you from entering a string (or even warn you). At least not in Excel 2003 (I don't know about newer versions).

As far as I know there is no validation done. Even in Excel things are lax. For example, if you set the format for a cell in Excel to "currency", Excel will not prevent you from entering a string (or even warn you). At least not in Excel 2003 (I don't know about newer versions).

so is there a way that the vb.net can validate the data from the excel file?

if so, how can it be done?

thanks

You can validate any data as long as you know what that data is supposed to be. If you are asking how to determine what formatting was set for a particular cell in the spreadsheet then I don't know. If you are importing data from a spreadsheet into VB then you should already have some idea of what format the data should be in so you shouldn't need to know the Excel formatting.

In any case. it may be afternoon in Rizal but it is after midnight here so I'm off to bed.

You can validate any data as long as you know what that data is supposed to be. If you are asking how to determine what formatting was set for a particular cell in the spreadsheet then I don't know. If you are importing data from a spreadsheet into VB then you should already have some idea of what format the data should be in so you shouldn't need to know the Excel formatting.

In any case. it may be afternoon in Rizal but it is after midnight here so I'm off to bed.

okay, thanks.. i already found a solution..

Be a part of the DaniWeb community

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