Akv Seiji

Akv Seiji

  • NA
  • 3
  • 5.3k

How to retreive formated arabic date in Excel using VB.NET

Feb 14 2011 12:37 AM
Hi,

I'm using oleDB in VB.NET to read database from Excel.
In Excel I have 2 columns datatype: DATE. 1st column contain usual date, 2nd column contain Arabic date (take value exactly from 1st column).

Table.png      Format.png



In VB, I have DataGridView to display table from Excel.

This is my coding:
da = New OleDbDataAdapter("SELECT * FROM [Sheet1$], oleConn) 'oleConn is OleDbConnection (initialize earlier)
ds = New DataSet

dgvData.DataSource = Nothing 'dgvData is name for DataGridView

da.Fill(ds, "dat")
dgvData.DataSource = ds.Tables("dat")




This is the result:
dgv.png


Now, my questions:
1. How can I show Arabic date format in column 'Adate' without change any format in Excel?
2. What is data type I must assign to retrieve Arabic date format for "CREATE TABLE", in case I want to store it in database (MySQL)?
   - I tried using DATE, CHAR, NCHAR, VARCHAR, TEXT, but it make no change..

TQ.





Answers (2)