RE: MSDASQL and ImportMixedTypes



Hello Mac,
Thanks for your reply.

I reviewed your code again and reproduced the issue on my side.
I noticed your web application using OdbcConnection rather than
OleDBconnection. I'm afraid the key word "Extended Properties" is not
supported in ODBC Connect string. It is only available in OleDB Connect
string.

Therefore, the OdbcConnection will ignore the Extened Property (IMEX=1).
The text cells are empty in your application. Changing the schema of
DataTable doesn't help in this case. It is the because that the drive ( not
net application) eats the data.

The way to resolve this issue is using OleDb.
Would you please try the OleDbConnection (if it is possible for you)?
ocn.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\Ntt\MTC-WebApp\MTC\Daily.xls;Extended Properties=""Excel
8.0;HDR=Yes;IMEX=1""";

Hope this helps. Please try the OleDbConnection (if it is possible for you)
and let me know the result. We are glad to assist you.

Have a great day,
Best regards,

Wen Yuan
Microsoft Online Community Support
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

.



Relevant Pages

  • Re: difference between OleDBConnection and SqlConnection?
    ... > whereas OldDBConnection in general uses any ODBC compliant driver ... so what is OdbcConnection good for if OleDBConnection does the same work? ...
    (microsoft.public.dotnet.general)
  • Re: ConnectionString for comma-delimited file
    ... data source in ODBC using the Microsoft Text Driver. ... OdbcConnection instead of OleDbConnection. ... FireStarter wrote: ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Problem with AddWithValue
    ... Also you need to be clear which provider you are using. ... As Dave wrote you can do it as well with the AddWithValue which replaces the ... Be aware that this is fonfusing because this is where SQLClient and OleDb ... using (OleDbConnection conn = new OleDbConnection( ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: How to read data from Excel spreadsheet?
    ... Most probably the sheet name is incorrect, ... Take a look at this code, it does read an excel without any problem, let me ... OleDbConnection srcConn = new OleDbConnection; ... // Connection String. ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: ldb file remains after closing connection
    ... private void button1_Click(object sender, EventArgs e) ... string name = Guid.NewGuid.ToString; ... private OleDbConnection m_db; ...
    (microsoft.public.data.oledb)