S
simran2102
HI,
I am trying to reading a .csv file from a remote desktop.
the connection string that i am using is as follows:
strConn = "Provider=MS Remote;"+"Remote Server=//<ComputerName>/
<FolederName>;" + " Remote Provider=Microsoft.Jet.OLEDB.4.0;"+"Data
Source="+@"d:/trial/try1.csv"+";"+"Extended
Properties='text;HDR=Yes;FMT=Delimited'";
With this connection string i am able to open the connection but when
i try to fill the data set it gives me the error:
"Specified Cast is not valid"
the line is
da.Fill(ds);
where 'da' is the OleDbDataAdapter and 'ds' is the dataset
The complete Block of code is as follows:
string strConn;
OleDbConnection conn ;
OleDbDataAdapter da;
strConn = "Provider=MS Remote;"+"Remote Server=//ind-spz4dxp612/
trial;" + " Remote Provider=Microsoft.Jet.OLEDB.4.0;"+"Data
Source="+@"d:/trial/try1.csv"+";"+"Extended
Properties='text;HDR=Yes;FMT=Delimited'";
conn = new OleDbConnection(strConn);
da = new OleDbDataAdapter("SELECT * FROM [TRY1.CSV]",conn);
da.Fill(ds);========== This Is The line which gives this error.
Your help and inputs will be appreciated.
Thanks.
I am trying to reading a .csv file from a remote desktop.
the connection string that i am using is as follows:
strConn = "Provider=MS Remote;"+"Remote Server=//<ComputerName>/
<FolederName>;" + " Remote Provider=Microsoft.Jet.OLEDB.4.0;"+"Data
Source="+@"d:/trial/try1.csv"+";"+"Extended
Properties='text;HDR=Yes;FMT=Delimited'";
With this connection string i am able to open the connection but when
i try to fill the data set it gives me the error:
"Specified Cast is not valid"
the line is
da.Fill(ds);
where 'da' is the OleDbDataAdapter and 'ds' is the dataset
The complete Block of code is as follows:
string strConn;
OleDbConnection conn ;
OleDbDataAdapter da;
strConn = "Provider=MS Remote;"+"Remote Server=//ind-spz4dxp612/
trial;" + " Remote Provider=Microsoft.Jet.OLEDB.4.0;"+"Data
Source="+@"d:/trial/try1.csv"+";"+"Extended
Properties='text;HDR=Yes;FMT=Delimited'";
conn = new OleDbConnection(strConn);
da = new OleDbDataAdapter("SELECT * FROM [TRY1.CSV]",conn);
da.Fill(ds);========== This Is The line which gives this error.
Your help and inputs will be appreciated.
Thanks.