asp.net动态获取Excel表名的代码
复制代码 代码如下:
public string GetExcelFirstTableName(string excelFileName)
{
string tableName = null;
if (ts(excelFileName))
{
using (OleDbConnection conn = new OleDbConnection("Provider=." +
"OLEDB.4.0;Extended Properties="Excel 8.0";Data Source=" + excelFileName))
{
();
DataTable dt = leDbSchemaTable(es, null);
for (int i = 0; i < t; i++)
{
tableName += [i][2]ring()();
view sourceprint?1 }
}
}
return tableName;
}
读取excel动态获取表名
复制代码 代码如下:
string a=ring();
string excelFilePath=a;
ication myExcel=new icationClass( ) ;
object oMissing = e ;
(excelFilePath,oMissing,oMissing,oMissing,oMissing,oMissing,oMissing,oMissing,oMissing,oMissing,oMissing,oMissing,oMissing,oMissing,oMissing) ;
book myBook = books[1] ;
sheet mySheet = (sheet)sheets[1] ;
e();
string Name=;
Table dt=new Table("mytable");
("F1", ype("ng"));
("F2", ype("ng"));
("F3", ype("ng"));
("F4", ype("ng"));
("F5", ype("ng"));
DataSet myDs = new DataSet();
(dt);
DataRow myRow;
r();
for( int i = 2 ; i <= 4 ; i ++ ) //第一行为标题,不读取
{
myRow = es["mytable"]ow();
for( int j = 1 ; j <= 5 ; j ++ )
{
e r=(e)s[i,j];
string strValue=ring();
string aa=strValue;
string columnname="F"+ring();
myRow[columnname]=strValue;
}
es["mytable"](myRow);
// }
();
Source=es["mytable"]ultView;
Bind();
-
浅析JavaScript基本类型与引用类型
两种类型:ECMAScript变量包含两种不同类型的值:基本类型值、引用类型值;基本类型值:指的是保存在栈内存中的简单数据段;引用类型值:指的是那些保存在堆内存中的`对象,意思是,变量中保存的实际上只是一个指针,这个指针指向内存中的另一个位置,由该位置保存对象;两种访问方...
-
php程序员的简历模板
日子如同白驹过隙,新一轮的招聘又在朝我们招手,这时一份好的简历可以起到很好的.作用哦。那么如何写简历才简练、明确呢?以下是小编收集整理的php程序员的简历模板,希望能够帮助到大家。基本简历姓名:黄先生国籍:中国现在所在地:广州民族:汉族户口所在地:潮州身材:170cm...
-
PHP开发工程师的主要职责
PHP开发工程师的主要职责1职责:1、负责公司后端的研发,保障系统的稳定性和质量2、与业务需求部门及项目经理沟通,理解需求,进行架构设计;3、搭建开发框架、负责核心代码的编写,解决技术难点;4、界定、分析和解决系统中存在的问题和缺陷;5、对系统进行持续改进,提升系...
-
关于HTML meat作用
meta标签用于网页的与中,meta标签的用处很多。meta的属性有两种:name和http-equiv。name属性主要用于描述网页,对应于content(网页内容),以便于搜索引擎机器人查找、分类(目前几乎所有的搜索引擎都使用网上机器人自动查找meta值来给网页分类)。这其中最重要的是descrip...
相关文章
- 雅思口语范文:My Experience as an English Learner
- 英语优秀作文:M Unfrgettable Experiences
- The Sprint in College Entrance Exam英语作文
- Asp.Net数据输出到EXCEL表格中的教程
- 托福英语写作范文:Examinations exert a pernicious influence on educat
- 英语阅读:TheTwelveDancingPrincesses
- Unforgettable experience 难忘的一件事作文
- 高中优秀英语作文An Unforgettable Experience
- 人教PEP版小学五年级英语下册Unit3Myschoolcalender.ALet’stalk
- 英语作文:An unforgettable experience