.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Excel column issue reading

Posted By:      Posted Date: October 21, 2010    Points: 0   Category :Sql Server

Hi Experts,

We have excel with one column which is actually Custom column and type is h:mm:ss (when I right click and seleting format cells).

So when I'm selecting any of the cell into the excel file, it has values in the for of h:mm:ss but when I look above the value "fx" it is different some thing like date + time + AM/PM ( for the same seleted cell ) ---- which means two different values for the same selected cell.

Now we need to load this excel file using SSIS to our DB table, I tried but it is loading upper value ( date + time + AM/PM ) and not the value which the selected cell is having h:mm:ss.

Suppose for an example I have selected on cell whose value is 41:48:57 but when I see above near by to fx it is having 1/1/1900 4:14:40 AM and SSIS is loading this value and not the actual value ( 41:48:57 "h:mm:ss" format).

So how to tell SSIS to load value in the form of h:mm:ss and not the date+time+AM/PM value? Tried my best to explain you guys.

Please let me know if you have any specific quesiton.



View Complete Post

More Related Resource Links

issue with excel data column



i have a excel sheet (excel 2003) and one of the column doesn't have value in all the rows. some of the rows have value and it is integer. when i use this sheet to import, in external column, it is showing data type as unicode string, i manually changed the data type of output column to different integer types but it doesn't shows any data.

if i go back to excel sheet, change the numeric value into text (add quote next to number '999999 instead 99999) it shows me the value. what is the best method to work with this issue.

one thing is for sure, if this column will have value that will be always integer.

any help,




mark it as answer if it answered your question :)

export to excel issue


Hello ,

I have a browser enabled form which i published to sharepoint ..now i want to export the contents of the form to excel..i have 1 repeating table and two repeating sections ..whenever i go to export to excel and then choose just one repeating table or a repeating section or any option other than export all form data i get an error ...first the progress bar just freezes and then when i end the task through task m anager i get a msg that microsoft excel could not start.make sure excel is installed correctly and then try again....

Can somebody tell me how to debug this..i have tried the export of a form containg repeating table and sections and it works good ..so that means there is some problem with my form..so now can somebody give me an idea as to what can the problem be and how can i debug it.


ASP.NET Excel Export Issue



I am trying to export data from SP to a .xlsx sheet. Total no of rows is more  than 15000 with total of 13 columns.The data is generated with the help of SQL Server SP. Till this point it is working fine. However while exporting to excel I do not get any data , the excel  has blank content.

If I have records less than 12000 it generated the excel report with  relevant data. However as row increases the report is blank.

Also the excel is generated through the code but when I deploy to server and try to generate it generates a blank excel. 

 Please advice what needs to be done. I have tried multiple options but none works.

Datasheet view lookup column issue


When a column that has a lookup is empty in datasheet view and I attempt to update a different column I get this message: the text entered for isn't an item from the list. select an item from the list, or enter text that matches one of the listed items.

I found this hotfix, but it did not apply.


Any ideas how to get this resolved?

reading excel file problem



i have 200 rows in my excel file. im using OleDbConnection to read the excel file.

The problem is that it will read all the blank rows from row 200 onwards. Is there a configuration im missing ? or is there a way to import all rows that has data? Here's some of my code.

string excelConnectionString =
               "Provider=Microsoft.Jet.OLEDB.4.0;" +
                "Data Source=" + filePath + ";" +
                "Extended Properties=Excel 8.0";

OleDbConnection excelConnection =
                    new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + filePath + ";Extended Properties='Excel 8.0;HDR=NO'");

OleDbCommand cmd = new OleDbCommand("Select * from [list$]",excelConnection);

Reading an excel file



i am trying to read an excel file.

when i read the entire file, it works fine.

but when i try to read a single column, i get the following exception message:

"Could not find installable ISAM".

the code i am using is:

string  connString = "Provider=Microsoft.ACE.OLEDB.12.0;" +  


"Data Source="+ fileName + ";" +


"Extended Properties=Excel 12.0;HDR=Yes";

OleDbConnection oledbConn = new OleDbConnection(connString);




// Open connection



// Create OleDbCommand object and select data from worksheet Sheet1

OleDbCommand cmd = new OleDbCommand

MySqlDataReader - Reading special column characters



I have a MySQL database, which contains columns with danish characters like ø æ and å.

When the MySqlDataReader tries to read this column name:

for (int i = 0; i < MysqlReader.FieldCount; i++)
       string Key = MysqlReader.GetName(i);


The result is not the expected character, but some kind of ASCII value of it. For an example, 'å' gets interpreted as 'Ã¥'.

What to do?

Thanks alot for your help :)

In export, i want to disable column in excel sheet

Hello, I am doing Import/Export. While export i want to disable some column in excel sheet, so during upload or import same primary key I can use, instead of user modify such column. Regards, Sandeep    

reading excel file without saving to disk first

Having an issue.  I need to be able to read an excel file from a file upload control but I can not save the file to disk first, it must be done in memory.string excelConnectionstring = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="; excelConnectionstring += filePath.Replace("/", "\\"); excelConnectionstring += ";Extended Properties='Excel 8.0;HDR=YES;IMEX=1;'"; OleDbConnection con = new OleDbConnection(excelConnectionstring); OleDbDataAdapter da = new OleDbDataAdapter();Above is my code for reading the data file if it IS saved to disk, but again, I have to be able to do this without saving the file to disk, it must be done in memory.  I have not been able to find any sample code anywhere on how to do this from memory, everything seems to force the file be uploaded, saved to disk, and then read in the connection string, which again I can not do.Any advise would be great, thanks in advance.  I'm really in a bind here.

Reading data from Excel 2007

I am attempting to read data from an uploaded spreadsheet using ACE.OLEDB. The code, which is running fine on dev and test machines for XL2003/2007 reports "External table is not in the expected format" error on connecting on the production server for XL2007 only. The code is Dim connectionString As String = "provider=Microsoft.Ace.OLEDB.12.0;" _ & "Data Source='" & ImportData.FullName & "';Extended Properties=Excel 12.0;" LogWebActivity.LogThis("Entering POPSUKD, ConStr=" & connectionString, LogWebActivity.LogDetailLevel.DetailAndData) Dim con As New System.Data.OleDb.OleDbConnection(connectionString) LogWebActivity.LogThis("Dimmed con", LogWebActivity.LogDetailLevel.Debugging) Try Dim cmdSelect As New System.Data.OleDb.OleDbCommand("SELECT * FROM [" & WorksheetName & "$]", con) Dim adapter As New System.Data.OleDb.OleDbDataAdapter(cmdSelect) Dim dS As New Data.DataSet LogWebActivity.LogThis(cmdSelect.CommandText, LogWebActivity.LogDetailLevel.Debugging) con.Open() LogWebActivity.LogThis("Opened Connection", LogWebActivity.LogDetailLevel.Debugging) adapter.Fill(dS, WorksheetName) LogWebActivity.LogThis("Filled DataAdapter", LogWebActivity.LogDetailLevel.Debugging) _SKUS = dS.Tables(W

An issue of using UDF in Excel Service

I am using Excel Service and it call an UDF(User Defined Function) to get data from a list. Currently I come accross following issues. Any one can give me suggestions are very appriciated. 1. In the UDF, if I marked the method as "ReturnsPersonalInformation=true". The data cannot be shown correctly, all cells appear "#Value?". 2. When I fist time upload a excel file to the Document Library, then open the excel on browser. All cells appear "<nativehr>0x80070005</nativehr><nativestack></nativestack>". When I manually click "Calculate Workbook", then the data comes correctly. Thanks again for any hints.

Issue while exporting to Excel

Hi All, We are having report in SSRS 2005, everything is working fine while Running the report on BIDS as well as on Report Server, but as soon as we export the report to Excel it is creating issue(S) not just a issue. First - I'm not able to see "Footer" in Excel, although it does exist in BIDS as well as Report Server. It is visible while doing Print-Preview in Excel, why so is it a bug, is their any work around to make it visible without doing Print-Preview, please do let me know! Second - It is regarding "Header", I have couple of text boxes in my Report Header, as soon as I include text boxes in Report Header and when I export to excel, the rows & columns height as well as width is getting disturb (meaning some getting compressed and some getting expanded), so to make it look attractive we have to manually arrange in proper order before delivering to our end-user, Can anybody tell me why rows & columns are getting disturbed and also how to arrange with exact height & width without any manual interpection, please help me out, this is getting me crazy?   Thanks Regards, Kumar

Trouble importing strange column format report from Excel 2007 to SQL 08

Hi, I'm not sure whether this belongs in this section or the SSIS one so hopefully I've got it right!  Hoping someone will be able to help with a problem I'm having importing a report with header and detail rows from our antiquated POS system into SQL 2008 tables.  The reports export in Excel 2007 format and for each header row there can be one or more detail rows starting from column B.  As such I've tried several things such as openrowset, an Access 12.0 OLE DB source in SSIS and even COM automation of Excel to try and write a conditional split which will hold the header details in variables then write them to rows alongside the detail rows.  I've pasted a small sample of the data here as I wasn't able to attach it: 01/07/2010 @ 11:18 Page: 1 RECEIVING: Voucher Journal Sort: VC|Str|Vou Date|Vou #|Document SID Filter: Voucher Date: 01/06/2010@12:00a..30/06/2010@11:59p Include Item detail: DCS|Item#|Desc1|Attr|Material|Size|Qty VC Str Vou Date Vou # Qty ABC 001 15/06/2010 12345 38 E NN 66 200148 XXXXXXXX RED SHAD E NN 66 200149 YYYYYYYYY BLACK GO E PP 60 200154 ZZZZZZZZZ BLACK CDE 002 16/06/2010 13839 8 F SA 35 217500 XXXXXXXX Natural F SA FL 218674 YYYYYYYYY Chalk F SA WE 221462 ZZZZZZZZZ White FGH 001 21/06/2010 13905 3 F SH 85 126260 XXXXXXXX Navy IJK 001 23/06/2010 13914 3 E AA 61 250005 YYYYYY

Weird Date vs Date/Time issue using a calculated column

I'm attempting to use the fab 40 attendance template. I don't need the time to show - Im able to hide that on the forms with jquery (endusersharepoint.com thank you!!) I WAS ATTEMPTING to create a calculated column called Start Date where the formula simply reads '=[Start Time]' When it's set to display 'Date Only' the date is off by a day. If I switch it to 'Date & Time' I get the correct date. Huh?

Reading Excel files from 64-bit ASP.Net app

I have an ASP.Net app that is running on a 64-bit server. Part of that app reads data from Excel files and loads that data into our SQL_Server database.I am using the ACE OLE driver to read the Excel files and it works great on my 32-bit development machine. When we deploy the app (from a 64-bit client machine) to our 64-bit server, I get this exception when trying to open the connection:"System.InvalidOperationException: The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine."There are many posts about addressing this issue, so I think these are my options:1. Compile the app for any cpu from a 32-bit machine and deploy it to the server (making the app 32-bit) - not desirable as ideally we would like to run the app in 64-bit mode2. Convert the excel file to csv then use more base .Net libraries to get the data out3. Install Office on the server and use the Microsoft.Office.Interop.Excel library to access the data - not sure if this will work though4. Purchase a conversion library5.  Wait for the 64-bit version of Office and use the new Microsoft.ACE.OLEDB.14.0 driver. - Can I get a Beta version now?I am looking for confirmation that my options are accurate/complete and guidance on which of these (or another option) are the most viable.Thanks, Mike

merging every 3 column in excel using macros

I would like to merge every 3 columns and so forth in excel. It will be as follow: Column A,B,C as one column continued with  D,E,F, and G,H,I, and so forth until say KU,KV,KW. please let me know how to create the macros to select and then merge it. Thank you

Dynamic Column in Excel Source

Hi,I am having Excel Source Which needs to be imported into Sql Server Table using SSIS.In the Excel Source I dont have Month and Year Column.But in Table I have Month and year column and both the columns are Primary Key columns.So i am not able to Import data from Excel to Table.So is there any possiblities to add Columns Dynamically in Excel source inorder to  get the Year and Month
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend