sql查询从excel获取列名。 [英] sql query to get the Column Name from excel .
本文介绍了sql查询从excel获取列名。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Hello Team,
我从实体获取数据。
我希望C#.I列中的列名为Excel方法如下。
private static string [] GetColumnRangeForExcel(IFileLog fileLog)
{
string [] townNameArray = null ;
if (fileLog.FileName) /// /错误245无法将类型'string'隐式转换为'bool'
{
townNameArray = 从[ + fileLog.FileName + $]跨度>;
/// /错误246无法将类型'string'隐式转换为'string []'
}
}
它给我的错误如上所示。请指导我如何解决它?
谢谢
Harshal
解决方案
;
/// /错误246无法将类型'string'隐式转换为'string []'
}
}
它给我的错误如上图所示。请指导我如何解决?
谢谢
Harshal
尝试:
SELECT * FROM [Sheet1
A1:A65536]
或
SELECT [F1] FROM [Sheet1
Hello Team,
I am getting the Data from Entity.
I want the column Name From Excel in C#.I wrote the Method as Follows .
private static string[] GetColumnRangeForExcel(IFileLog fileLog)
{
string[] townNameArray = null;
if (fileLog.FileName) //// Error 245 Cannot implicitly convert type 'string' to 'bool'
{
townNameArray = "select Town Name from [" + fileLog.FileName + "$]";
//// Error 246 Cannot implicitly convert type 'string' to 'string[]'
}
}
its give me error as shown above.Please Guide me how to solve it ??
Thanks
Harshal
解决方案
"; //// Error 246 Cannot implicitly convert type 'string' to 'string[]' } }
its give me error as shown above.Please Guide me how to solve it ??
Thanks
Harshal
Try:
SELECT * FROM [Sheet1
A1:A65536]
or
SELECT [F1] FROM [Sheet1
这篇关于sql查询从excel获取列名。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文