read screenshot in excel file

Posted by Oswaldlily under ASP.NET on 5/3/2013 | Points: 10 | Views : 848 | Status : [Member] | Replies : 1
I have excel file with screenshot inside excel..

Now i need to read this screenshot from excel and store into datatable...

How is this possible.

if each row of excel has values in cell ,following code will be helpful..
if has screenshot,how to store in datatable

string HDR = hasHeaders ? "Yes" : "No";
string path = FileName;
DataSet output = new DataSet();
string strConn = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + path + ";Extended Properties=Excel 12.0;";
using (OleDbConnection conn = new OleDbConnection(strConn))
{
conn.Open();
System.Data.DataTable dt = conn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, new object[] { null, null, null, "TABLE" });
foreach (DataRow row in dt.Rows)
{
string sheet = row["TABLE_NAME"].ToString();
OleDbCommand cmd = new OleDbCommand("SELECT * FROM [" + sheet + "]", conn);
cmd.CommandType = CommandType.Text;
System.Data.DataTable outputTable = new System.Data.DataTable(sheet);
output.Tables.Add(outputTable);
new OleDbDataAdapter(cmd).Fill(outputTable);
}
}
return output.Tables[0];




Responses

Posted by: Learningtorise on: 5/3/2013 [Member] Starter | Points: 25

Up
0
Down
Not possible, if by ScreenShot u mean an image!
You can not read image!!

http://hashtagakash.wordpress.com/

Oswaldlily, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response