read url link from excel file with C#
I have the following code:
private DataSet GetDataSet(string tableName)
{
DbCommand cmd = GetConnection().CreateCommand();
cmd.CommandText = "SELECT data FROM " + tableName;
DbDataAdapter da = GetDataAdapter();
da.SelectCommand = cmd;
DataSet ds = new DataSet();
da.Fill(ds, "query");
DataTable dt = ds.Tables["query"];
foreach (DataRow row in dt.Rows)
{
foreach (DataColumn col in dt.Columns)
{
Console.WriteLine(row[col]);
}
}
return ds;
}
is it possible to read url link from excel file?
I have in ex开发者_Go百科cel link like:
PARK
but when i read from excel i see onl word PARK and no link.
/Regards
OleDB can only read the raw data in the cells.
If you want to read formatting (including hyperlinks), you'll need to use COM Interop to automate Excel or buy a third-party Excel library.
精彩评论