开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜