.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

connection to excel

Posted By:      Posted Date: August 31, 2010    Points: 0   Category :ASP.Net
Hello Dear; If i choces bad topic for ask sorry . I have sms portal for send sms.part of this prtal send sms from excel file contian mobile number. my portal was share hosting.Now i buy VPS server but send from excel not work. Will my server needs addons from office family. Note:I use OLEDB connection for connect to excel file

View Complete Post

More Related Resource Links

Excel Connection Manager Problem

I am building a package that has 2 tasks that need to use the same excel connection manager. I use a execute sql task to dynamically build a table from the headers of the excel sheet  ,then I use an excel source component to load the data from the sheet. However when I try to edit the excel source and switch the data access mode to a variable and select the variable(for the path), when I try to close the editor I get this message 'S:\myfolder'.  It is already opened exclusively by another user, or you need permission to view its data. I need this package to access the same folder each time because the files will be placed in that folder. This package also has a branch for loading a text file into sql server. It access the same folder but uses a flatfile connection manager It looks like permissions on the folder are correct

Can not get excel connection when calling an SSIS package from ASP

I have an SSIS package importing data from excel. I have coded it and deployed it on the sql 2008 server. I then execute it via a stored procedure with the following: select @cmd = 'C:\"Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\DTExec.exe" /sq "HRIS"' select   @cmd = @cmd + ' /SET \Package.Variables[User::path].Properties[Value];"' + @path + '"' exec   @rtn = master..xp_cmdshell @cmd   This works fine when  i execute it on my local machine. But when I try to call this Stored proc from my asp app (classic asp, not .net) I get the error: Code: 0xC0202009 Source: HRIS Connection manager "SourceConnectionExcel" Description: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005. An OLE DB record is available. Source: "Microsoft JET Database Engine" Hresult: 0x80004005 Description: "Unspecified error". End Error   Any help would be greatly apprecitated

How to change connection string of a pivot table pointing to SSAS 2005 cube using excel 2003?

Hi All,I am not sure if I should have posted this query to Excel 2003 forum. But posting it here as it applies to SSAS 2005 as well.Ok, let me give the background before I tell the actual problem.We have users on ABC domain and the SSAS server is also on ABC domain. Users on this domain can acess the excel pivots by connecting to cube to browse the data. They leave the Userid & password field blank while they setup the connection string and it works fine. Thanks to windows authentication that takes the credentials of user logged in. Let's say I have two users A and B, they login to ABC domain with their own windows ids.  Now when user A creates a excel file having a cube pivot and then sends this file to user B, user B can refresh and modify the same excel file (he can select new measures to pivot, new hierarchies in filters and so on).Now, let's say I have another user, user C. He has excel 2003 installed on his PC and cannot migrate to excel 2007. He is on different domain XYZ but have a valid windows userid on domain ABC. The domain ABC & XYZ can not be setup to have trusted relationship. Now, when user A sends the same excel file to user C. When user C opens the file and try to refresh it or try to modify the pivot by selecting/deselecting any elements, he gets below error prompt:" An error was encountered in the transport layer." and "Errors in the

How to update single cell of excel sheet using oledb connection,

 Friends i got some codes from net  by using that i can update a excel sheet ,but there we have to specify some header fields name in command string like as fallows ,Update [Sheet1$] set ProductName="IBG" where ProductId=5but i want to update a single cell of excel sheet only,let say O12 cell i want to change somedata,how it is possible that i don't know.plz help me out... thanks in advance...  

SSIS Excel Connection Manager Data Type Conversion Issues with SS Agent Job

Hi All! I have an issue I've been trying to fix but can't seem to figure it out. I was hoping a kind person would point me in the right direction. :o) I have an SSIS package that uses an excel connection manager source, and I want to run this package through a job scheduled in the SQL server agent. The data types for the excel file fields are 2 (DT_WSTR) and 5 (DT_R8). When I run the package directly through the SSIS package (VS solution) all of the data fields are properly imported into the database table. But...when I run this package through the SQL server agent job, ONLY the string (DT_WSTR) fields in each row are being imported, all of the float fields are imported as NULL. I set the data types for these float fields as "float" in the SQL server import table (data type). Even though the excel source float fields are indicating a type of DT_R8 in the excel connection manager and I set the data types in the SQL server table to "float", I also used the data conversion component and set the type to "float" as a fail-safe. I guess I should add to that the data access mode in the excel connection manager is using a custom code to select only those columns that I needed and to trim rows that I didn't need. Here's my code that I have in the excel source editor: select f1, f2, f3, f5, f6, f7, f8 from [mdo$] where f2 <> 'Rep Name'

SSIS 2008 - Excel Source using SQL Connection cancels as soon as package runs.

Let me preface this by saying I'm brand-new to SSIS development. I'm using 64-bit SSIS 2008 and I'm trying to read an Excel spreadsheet using OLE DB. I've already run into and corrected the Run64BitRuntime problem.  Now when I invoke the Package it cancels immediately with the following output: SSIS package "Lesson1X.dtsx" starting. Information: 0x4004300A at Data Flow Task, SSIS.Pipeline: Validation phase is beginning. SSIS package "Lesson1X.dtsx" finished: Canceled. The program '[5400] Lesson1X.dtsx: DTS' has exited with code 0 (0x0). When I edit the Excel Source component itself there are no errors and I am able to Preview the results successfully.  If I use Table or View to access the file, the package runs successfully. Any suggestions will be greatly appreciated. Thanks

Excel Connection Manager: Use OpenRowset with Space(s) in Worksheet Name


Is there a way to use Excel Connection Manager with OpenRowSet when the worksheet has a space in the name (e.g. "My Sheet").  I am using SQL Server 2008R2.

OpenRowset works fine without spaces in the worksheet name, but generates an error when a space is present.  I have tried multiple [] and ' ' combinations to bracket the worksheet name. 

JG4 documented the same problem in a posting titled "Skipping leading rows in Excel" (at the bottom of the thread):



Excel Services connection issue


Hi All,


We have an spread sheet which is pulling data form SSAS. The spread sheet works fine when refreshed individually but when we publish it to SharePoint, we can't refresh it and the following error shows up. What account is used to connect to SSAS when Exl. services is connecting to SSAS? Any idea how to fix this?


Thanks in advance.


An error occurred during an attempt to establish a connection to the external data source. The following connection failed to refresh.


Import Excel file with Data Connection into SSIS


I have got an Excel spreadsheet with a Data Connection that I want to import into SSIS. The problem is that the Data Connection does not seem to run at the time the file is imported, so it only calls "old" data.

How can I set SSIS up to run the Data Connection first, or is there something I need to change in my Excel spreadsheet setup?

When a person opens the Excel file normally, they first need to "Enable" the Data Connection in the Security Settings. Once that is done the data will update immediately. I wonder if that is something I somehow need to change to make it work in SSIS?

SSIS import Excel with Data Connection


Hi guys, I am trying to use SSIS for the first time. What I am hoping to do is set up a scheduled job that will get SSIS to read an Excel spreadsheet on a regular basis and import the data out of it into an SQL Server database. Now my Excel spreadsheet uses a Data Connection to a different source and I want the data to be refreshed before SSIS imports it. Is that possible?

The problem I am facing right now is that the Data Connection does not seem to run before SSIS import the data. It keeps importing the old data that was sitting in the Excel spread sheet at the time it was saved last.

Is there any way I can tell SSIS to run the data connection first? Or is there something I need to do in my Excel file to ensure the connection is run?

By the way: the Excel file is set up to run the Data Connection immediately when it is opened normally in Excel, but the general user always first has to go into the Security Settings and enable Data Connections.

Thanks for the help!

Connection time out + excel file upload + ajax async as a fix?


Thank you in advance for taking the time to read this.

I have a C# ASP.NET page that allows users to select 2 excel files from their machine and click a button to compare and look for differences.  Any difference is output to a gridview for them to review.  The code works brilliantly on my machine, on other machines inside our network, ect but when we try to access this page from outside the network and use excel file sizes around 1mb a piece, we're seeing a connection timed out error in IE (v6 and v7).

Due to limitations beyond my control, I can not save the files to the server first and then do my comparison code.  Instead I have to read the files to memory and am using a .dll found here, http://exceldatareader.codeplex.com/.  It basically reads the excel files into datasets, which are then passed on to my comparison method.

What appears to happen is that the comparison code takes some time, depending on the file size.  For example, 20kb Excel files net results with no errors in just a few seconds.  200kb files take longer but still succeed.  1mb files, though, get the connection timed out but only in IE and only outside our network.

So my thought was that perhaps the browser isn't getting the results back from the server fast enough and issues the connecti

Excel Connection Manager DYNAMIC


Hi Experts,

I have Excel Connection Manager's Connection String as:-

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\TEMP\ABC.xls;Extended Properties="EXCEL 8.0;HDR=NO";

But I want to make it dynamic by using my Package variable something like this:-

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\TEMP\+@[User::FileName]+;Extended Properties="EXCEL 8.0;HDR=NO";

But it is giving me error, so to change Excel Connection Manager connection string to make it dynamic?

Any Help




The AcquireConnection method call to the connection manager "Excel Connection Manager" failed with e


I have deployed my packages into Sql Server and I am using Configuration File. As my Data Source is Excel, I have changed the connection string during deployment with Server Path. But I am getting the following errors. Actually the File Exist in Path. May I know What is cause of the issue? Do I need to give any permission to execute the package.


SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.  The AcquireConnection method call to the connection manager "Excel Connection Manager" failed with error code 0xC0202009.  There may be error messages posted before this with more information on why the AcquireConnection method call failed. 


component "Excel Source Service Contract Upload" (1) failed validation and returned error code 0xC020801C. 

One or more component failed validation. 


There were errors during task validation. 

DTS_E_OLEDBERROR, Error Code: 0x80004005 Source: "MS JET DB Engine" Description : Path is not valid


can't insert a group of data into excel using OleDb connection

OleDbConnection MyConnection;
                OleDbCommand myCommand = new OleDbCommand();
                string sql = null;
                MyConnection = new System.Data.OleDb.OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Project\Sample1.xls;Persist Security Info=False;Extended Properties='Excel 8.0;HDR=YES'");
                myCommand.Connection = MyConnection;
                sql = "Insert into [first$] (Name,Group) values('jag','f');";
                myCommand.CommandText = sql;
this the code. and the error is- syntax error in insert into statement as it is not able to insert.
if i use "insert into [first$] (Name) values('jag');" its working..but the subsequent update statem

OLEDB Connection for Excel not a valid file path


Hi there, I'm using a FileUpload control on a webform to allow users to select an excel file. I then want to read the excel file and dump the data into a dataset, but I can't get it to work. This is my code:

Dim fileNameString As String = Me.BillUpload.FileName
Dim filePathString As String = Me.BillUpload.PostedFile.FileName
Dim fileLength As

Excel services external data source connection


can't connect to an excel services data source on the sharepoint 2010

Error : ... can't connect to external datra source .....

Excel Services data connection issue. Single environment, none authentication


I really need someone's help to configure my SharePoint 2007/ Excel services connectioon to SSAS 2008. It surely cannot be that complicated???

MOSS on server 1
SSAS 2008 cube on server 1
Trusted data provider created (OLE DB, MSOLAP.4)
Trusted data connection library created
Trusted File location created - children trusted, allow external data = "Trusted data connection libraries and embedded"
Unattended Service Account - setup

I use Excel and create a new .odc file with athenticated type = NONE and save it to the Trusted data connection library. Using the odc I open a new workbook. I firstly get a security warning saying that "MS Office has identified a potential security concern. Data connections have been blocked. If you choose to enable data connections..."

I click on Enable, and now have access to my cube. I create a pivit table and chart and publish the workbook back to a child folder in the Trusted File location. All okay so far!!

Now I open the new workbook, and as soon as I try and interact with it, I get the dreaded error "Unable to retrieve external data for the following connections:


The data sources may be unreachable, may not be responding, or may have denied you access

Verify that data refresh is enabled for the

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