When i try to import excel data with Oledb. The column
who have number value and blank value is not im my
dataset.
For the importation i do
OleDbDataAdapter oCmd=new OleDbDataAdapter("SELECT * FROM
[sheet1$]",strCn);
DataSet oDS=new DataSet();
try
{
oCmd.Fil(oDS,"ExcelInfo");
dataGrid2.DataSource=oDS.Tables[0];
}
Could give me an answer. What can i do in my code for
having this column.

Lukas
.

Re: Excel Transfert by Paul

Paul
Tue Sep 02 10:07:01 CDT 2003

On Mon, 1 Sep 2003 04:39:11 -0700, "lukas" <lukas.kala@free.fr> wrote:

¤ When i try to import excel data with Oledb. The column
¤ who have number value and blank value is not im my
¤ dataset.
¤ For the importation i do
¤ OleDbDataAdapter oCmd=new OleDbDataAdapter("SELECT * FROM
¤ [sheet1$]",strCn);
¤ DataSet oDS=new DataSet();
¤ try
¤ {
¤ oCmd.Fil(oDS,"ExcelInfo");
¤ dataGrid2.DataSource=oDS.Tables[0];
¤ }
¤ Could give me an answer. What can i do in my code for
¤ having this column.

If I understand your question, it sounds like you're getting a null value when using mixed data
types in a column. Try adding the IMEX argument to your connection string

ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
'"Data Source=D:\My Documents\Book2.xls;Extended Properties=""Excel
8.0;HDR=NO;IMEX=1;"""


Paul ~~~ pclement@ameritech.net
Microsoft MVP (Visual Basic)