[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.axapta.programming

create aexcel file and put data into the file!?

PZ

1/16/2006 9:27:00 AM

I use ASP.net with c#...
there are some code of my test file:
I have some problem...
the connection string is alway
error-->("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\aaa.xls;Extended
Properties=Microsoft Excel 11");
the error message is: didn't find ISAM

string strSheetName="Sheet1";
string strCreate="CREATE TABLE"+strSheetName+"(RollNo char(255),FirstName
char(255),MiddleName char(255),LastName char(255))";
OleDbConnection objConn= new
OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\\aaa.xls;Extended Properties=Microsoft Excel 11");
objConn.Open();
OleDbCommand objCmd=new OleDbCommand();
objCmd.CommandText=strCreate;
objCmd.ExecuteNonQuery();
//-------
string BP1="TFN Domestic Long Distance EA";
DataSet ds=this.CodeSourceMgr.GetListBySql("select * from
SE_TB_INTEC_ISR_REPORT where TIR_NAME='"+BP1+"'");
DataTable tbl = ds.Tables[0];
DataRow dr=tbl.Rows[0];
Label1.Text=dr["TIG_NAME"].ToString();
//-------------