.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

How to send data from WPF UI to excel file?

Posted By:      Posted Date: August 28, 2010    Points: 0   Category :WPF
How to send data from WPF UI to excel file? Thanks.

View Complete Post

More Related Resource Links

Create excel file from Binary data on SqlServer



My requirement is that i upload an excel file then i need to validate that data.


1. Uploading file using using upload control saving binary in SqlServer

2. Then i am creating file from binary data  on Sql Server using below command and then using OPENROWSET to dump data to Sql table

3. Then reading Sql Table row wise and validating data.


Alter Procedure spUploadExcelFile
  @PKID int,
  @BatchID int


	Declare @VarBin varbinary(max)
	Declare @FileName varchar(100)
	DECLARE @sql nvarchar(MAX)
                DECLARE @errMsg nvarchar(MAX)
	DECLARE @ObjectReturn INT
	DECLARE @ErrorSource VARCHAR(255)
	DECLARE @ErrorDesc VARCHAR(255)
	DECLARE @ObjectToken INT

	Select @VarBin  = Content , @FileName = [FileName] from MultilangBinaryData Where PKID = @PKID
	SET @FileName = 'C:\'  + @FileName
	EXEC sp_OACreate 'ADODB.Stream' @ObjectToken OUTPUT
	EXEC sp_OASetProperty @ObjectToken, 'Type', 1
	EXEC sp_OAMethod @ObjectToken, 'Open'
	EXEC sp_OAMethod @ObjectToken, 'Write', NULL, @VarBin
	EXEC sp_OAMethod @ObjectToken, 'SaveToFile', NULL, @FileName, 2
	EXEC sp_OAMethod @ObjectToken, 'Close'
	EXEC sp_OADestroy @ObjectToken  
	SET @sql = 'INSERT INTO dbo.UserBulkData SELECT 0,NULL,'+ @BatchI

Insert Excel Data via File Upload into sql server database???

Hi all, I have requirement that User can Upload the Excel Sheet Data to sql server Database at once. How i do that Any Article or hint is apperciated.   Regards 

how to write data to excel file

Hi, can any one plz tell me how to write data in and excel sheet. when i retrive the data by foreach loop i want to dynamicaly create a excel sheet and save data inside the sheet.  Please help

Unable to export data to an excel file in grid format!!!

I'm exporting data to an excel sheet from the ojects list. The data is exporting to excel sheet well, but I'm unable to see the grid format for the data. The data is looking with out the rows and columns lines. I think I'm missing to set some property or somethnig ehwn exporting.   Any help would be really appriciated.

Using HttpWebRequest to send POST data with parameters and a file

I have a form that has the following<form action="http://site" enctype="multipart/form-data" method="post"> <input type="hidden" name="action" value="the action" /> <input type="hidden" name="apiKey" value="key here" /> <input type="hidden" name="name" value="racing" /> <input type="hidden" name="title" value="Race Cars" /> <input type="hidden" name="signature" value="sig here" /> <input type="file" name="file" /> <input type="submit" name="_upload" value="Upload" /> </form>I know its not .net controls.. but hat doesn't matter for now, what I need to do is post this form with all it's data, but entirely in code.I have found this post: http://www.developmentnow.com/g/36_2005_3_0_0_300351/Using-HttpWebRequest-to-send-POST-data.htm this describes how to do it but I am not getting it.I will have a file upload on my page and a textbox for name and title, but the rest are generated in code.I know it's a long shot, but can anyone give me an example of exactly how I would do it for  my scenario? I have been at it all day and I am struggling! I keep getting bad gateway errors when

How to read an Excel file and show data from 2 columns

Hi,I have an Excel file called Products.xls .I have Columns A and B, with the titles NAME and QUANTITY.The name of the sheet is SHEET1.The file has about 40 lines.How do i show these data on a Gridview or Listview ?Thank you.

How to convert a Excel file data into XML fastly

Hi all,        I have a excel file thats having content of the persons details.My code is as follows.Approximately the Excel sheet having 10,000 records   Form Load  ======= Conn = new OleDbConnection(ConnectionString);             try            {                if (Conn.State == ConnectionState.Closed)                    Conn.Open();                 string sql = "SELECT * FROM [Sheet1$]";                Cmd = new OleDbCommand(sql, Conn);                 DataAdapter.SelectCommand = Cmd;                                DataAdapter.Fill(ds, "Import_XML");                Rec_count = ds.Tables["Import

data type problem in import data from excel file


Dear All,

I am importing the data from excel file using following code.

connstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(strFolderFileName) & ";Extended Properties=HTML Import;"
                conn = New OleDbConnection(connstr)
                Dim strSQL As String = "SELECT * FROM [" & strWorkSheetName & "]"

                Dim cmd As New OleDbCommand(strSQL, conn)

                Dim da As New OleDbDataAdapter(cmd)

Now the problem is if a coulmn vlaue start with a number value like "15" then the other string value like "W15" in that column is ignored in the datatable.

eg. The excel column value     Column1


Excel File as input paramter for Lookup Data Flow Transformation problems


Before I start, I'm using SQL 2008.

I have a Excel file with email addresses that need to acts at input parameters to a Lookup transformation. I have set the Excel Source to my file and specified the email field to be the output. I have dropped the Lookup Transformation Data Flow and connected the both. I'm going to execute a very simple stored procedure, and under the Connections section my SQL query looks like follows: EXEC Test_GetUserName ? 
When I run that I get an error saying that no parameter was provided. But when I run EXEC Test_GetUserName 'someemail@companyname.com' everything executes great, for the obvious part that the email is hard coded. How do I pass the excel input as the parameter?

Thanks for all the help.

There is 10 types of people in the world, those that understand binary, and those that don't.

How to send binary data ( ogg audio file) using a web service?


Hi folks, I would appreciate any help or guidance on this topic:

How can I receive binary data (specifically an ogg audio file) using a WCF4 service?

The general idea is to define and host a WCF service inside IIS that returns an audio file (ogg file)

I have read some info related with using ByteStreamMessageEncodingBindingElement class to achieve this, also I read some topic related on using MTOM to attach a binary file. It seems that it can be several ways or approaches to achieve this.

So any guidance on the themes and/or examples for the better way to solve this point would be very appreciated.

Thanks in advance.



Data Export to Excel file using "Response.ContentType = "application/csv"


I have developed code to export data to Excel using Response.ContentType = "application/csv". The output Data Excel file loaded with 65536 Rows only, this file is not loaded completely since the limitation of excel is 65536. My Recordcount is more than 700000.

Please any one let me know how I can Export Data to Excel file over than 65536 Rows.

Email: thamaraiselvann@ayso.org

Create Excel file dynamically in SSIS package and fill it by resultset data returned by Stored proce


Hello Every One,

I have a scenario in which i am executing a Stored Procedure which returned a result set.

I want to create a Excel file [name_date_time] dynamically, and fill result set data into Excel file. And then finally sent Excel file to Specific user[Email ID].

Point is that the excel file should have unique name so i want to give name as name_date_time.

So every time when package run new file is created with unique name.


Can any one suggest me who to create Excel file and fill result set data into Excel file.

And then finally send that Excel file ?







I want a web service which will pick the data from sqldatabase and send a xml file for every row of


I want a web service which will pick the data from sqldatabase and send a xml file for every row of sql table in output folder.

i.e-if i have 5 records in database then that webservice should return 5 xml document in folder.

Is this possible?

If yes please let me know how can i do this ....

Thanks in advance


Read Data From Excel File


Private Sub DoMSExcel(ByRef ds As DataSet)
            Dim selectConnection As New OleDbConnection
            selectConnection.ConnectionString = ("Provider=Microsoft.Jet.OLEDB.4.0;Data source=" & Me.myFilePath & "; Extended Properties=""Excel 8.0;""")
                enumerator = Me.TablesMapped.Keys.GetEnumerator
                Do While enumerator.MoveNext
                    Dim dataSetTable As String = Conversions.ToString(enumerator.Current)
                        Dim sourceTable As String = Conversions.ToString(Operators.ConcatenateObject

Insert Data to table from excel file


guys, i am new to sql development

my question is how do i import data from an excel table,

i was trying to do it via a query and just paste the values, but received a syntax error. thanks

data structure is:


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?

Import data from excel file to datagridview in vb.net


 Dim DBConnection = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=E:\vb.net\2210201\new marks analysis system\new database\stu_basic.xls;Extended Properties=""Excel 12.0 Xml;HDR=Yes""")
        Dim SQLString As String = "SELECT TOP 1000 * FROM [Sheet1$]"
        Dim DBCommand = New OleDbCommand(SQLString, DBConnection)
        Dim DBReader As IDataReader = DBCommand.ExecuteReader()
        dg.DataSource = DBReader




i am using this but its doing nothing .

no errors , no data from excel.

whats the problem in it.?

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