ADO.NET :: Uploading Excel Data To Sql Database In .net Application?

Sep 17, 2010

What is the efficient way to upload excel data to sql database?excel file consists of 4000 rows..so i need to save these records to sql database in web application,i know only by creating ODBC connection i.e

_path = @"Driver={Microsoft Excel Driver (*.xls)};DriverId=790;Dbq=" + _path;
OdbcConnection _xlsConn = new OdbcConnection(_path);
_xlsConn.Open();
OdbcCommand _xlsSelSht = new OdbcCommand("Select " + columns + " FROM [" + _sheet + "$]", _xlsConn);
OdbcDataReader _xlsReader = _xlsSelSht.ExecuteReader();
while (_xlsReader.Read()){.....}

View 7 Replies


Similar Messages:

Databases :: Uploading Excel Sheet When My Application Running On Local Host

Feb 8, 2011

there is broblum for uploading excel sheet when my application runing on local host but there is no problum on vs enviroment . i am using the following connection string code

strConn =
"Provider=Microsoft.Jet.OLEDB.4.0;" +
"Data Source=" + path +
";Extended Properties=Excel 8.0;"
;

View 3 Replies

C# - Best Practice For Uploading Excel Data In SQL Server Using .NET

Mar 4, 2010

I am looking for best practice for uploading excel data in Sql server 2000 database through asp.net web application. Excel data will be predefined Format with almost 42 columns and out of 42 10 fields are mandatory and rest are conditional mandatory. i.e. if data exists it should be in defined format. I also need to validate for special character, length, specified format and so on.After validating, i need to store valid data into sql server table and provide export to excel functionality for invalid data for exporting in same excel format with indicator to identity the invalid cells.

View 3 Replies

Configuration :: Uploading A File For Importing Data From Excel?

Aug 27, 2010

I facing a problem when I upload a file from my side while the application is running in server.

The error shows below:

'C:Excel FilesStaff Directory1.xlsx' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.

View 4 Replies

DataSource Controls :: Uploading Data From Excel Sheet Into DB Dynamically

Jun 28, 2010

I want to upload data from an Excel Sheet into my DB. Now my major requirement is, I do not know the header count in the files to be uploaded and they may vary, for example one file may have 3 headers while some may have 6. and I want data of both these files to go into a single DB. That is, I want to dynamically generate columns in my DB, and store these values. So how do I go about achieving this.

View 4 Replies

Data Controls :: Update Existing Table Data By Uploading Excel File

Jan 24, 2016

Currently I was done to insert data thru upload excel file. May I know, how to UPDATE the existing data using iploading excel file.

View 1 Replies

VS 2008 - Uploading Excel Data To Dataset, Then DataSet To SQL Server?

Jan 18, 2010

What I am thinking is this? Is it possible for me to upload the data from an excel file to dataset of my application first, so that the user can view the data in a gridview to review it first, before the user strike the save button, to save it in the database. So, that in case there is a problem, the gridview will high light all the data with an error. So the user can easily pull out the excel and correct the data before saving it in the database.

View 4 Replies

VS 2010 Uploading Problem: Excel To SQL?

Dec 15, 2010

I received this error after I have deployed my application in the server (win 2003) but in my development pc it is working.

Code:
External table is not in the expected format.I can upload even the excel files is more than 30MB in file size.

View 6 Replies

Uploading Of Excel Sheet To Portal

May 3, 2010

I have a web page which I have created to allow users to upload excel file sheet and thus these sets of data will be inserted into the database. However, as I was testing out, I realized that if the excel file is too large (i.e. mulitple sheets, > 5 sheets) , the portal may not be able to handle the large amount of data and displayed error message like the connection is reset. I tried it with only less than 5 sheets it will be fine. Any idea if there are any codes or mechanism which could solve this problem?

View 6 Replies

Web Forms :: Show Progress Bar While Uploading Data In Database

Oct 16, 2013

I want to show progress bar while uploading data in database.. How can it be achieved. Also a message be displayed if file uploaded or not...

View 1 Replies

Find Duplicate Records In Excel While Uploading?

Mar 25, 2011

I am a beginer in Developing ASP.NET webpage.

I want to restrict duplicates while uploading the excel data and to inform the user that the perticular cell in excel contains duplicate value which is already exist in Sql Database.(Duplicates should be check in Excel (EMP_ID) against SQL (EMPLOYEE_ID)

SQL DATABASE

Table : Employees

FiledName:EMPLOYEE_ID

Excel DATABASE

Sheet: Sheet1

Column: EMP_ID

Message should display as:user cannot upload the data to with duplicate values. Kindly remove the duplicate fields and re-upload.

View 1 Replies

VS 2010 File (Excel) Uploading And Processing

Sep 27, 2011

I come from MVC side, where these things make more sense (of course just because I know a bit about it) and my webforms are still sucky sucky.

I got a page where I want the user to upload a file (Excel).

Not too worried about the upload timing out, but after uploading this file will be processed (time & attendance data to be written to the database)

So what I'd like to happen is everything happen asynchronously with the page being updated as the file are being processed.

Also, I'm not sure.. won't I need excel on the server to have my code read the excel file?

View 4 Replies

C# - Access To The Path Denied When Uploading Excel File

Dec 2, 2010

when uploading an excel file i am receving this error.

[code]....

View 3 Replies

DataSource Controls :: Uploading / Reading Of Excel 07 Files?

May 10, 2010

I'm able to upload and read any excel file to my server prior 2007, when I try an 07 Excel file, i'm getting the following error message:

'microsoft.ace.oledb.12.0' provider is not registered on the local machine'

do I need anything specail on the web server to allow for Excel 07 files? I'm running IIS6 and a Win 2003 server

View 1 Replies

Uploading An Excel File ( Containing Int Values )using The Fileupload Control?

Oct 8, 2010

I am uploading an excel file ( containing int values )using the fileupload control. I need to work on one entire column in the excel sheet.I want to copy contents of the file either in an array or a table and then work on it.Can anybody suggest a better way of working on the excel since .

View 4 Replies

Forms Data Controls :: Image Uploading To Database - Get Error On Running

Jun 23, 2010

I am uploading images to database....but only error that I am getting at this point when I run it is for.....

DataSource.InsertParameters.Add("MIMEType", MIMEType)

The error for the above line is Object not set to an instance of an Object look over the code an see if you can see what is wrong.

Protected Sub Button_Insert_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button_Insert.Click
'Make Sure a file has been successfully Uploaded
If FileUpload_Image1.PostedFile Is Nothing OrElse String.IsNullOrEmpty(FileUpload_Image1.PostedFile.FileName) OrElse FileUpload_Image1.PostedFile.InputStream Is Nothing Then
Label_ErrorMessage.Text = "Error"
Else
Label_ErrorMessage.Text = "No Error"
'Exit Sub
End If
'Make sure we are dealing with a JPG or GIF file
Dim extension As String = Path.GetExtension(FileUpload_Image1.PostedFile.FileName).ToLower()
Dim MIMEType As String = Nothing
Select Case extension
Case ".gif"
MIMEType = "Image/gif"
Case ".jpeg", ".jpe"
MIMEType = "Image/jpeg"
Case ".png"
MIMEType = "Image/png"
Case Else
Label_ErrorMessage.Text = "Invalid Type"
'Exit Sub
End Select
Dim DataSource As New SqlDataSource()
DataSource.ConnectionString = ConfigurationManager.ConnectionStrings("ConnectionString").ToString
DataSource.InsertCommandType = SqlDataSourceCommandType.Text
DataSource.InsertCommand = "Insert Into ClassifiedImages (Title, DateUploaded, MIMEType, ClassifiedId) Values (@Title, @DateUploaded, @MIMEType, @ClassifiedId)"
DataSource.InsertParameters.Add("Title", "Images For Classified Ad" & " " & Request.QueryString("ClassifiedId"))
DataSource.InsertParameters.Add("DateUploaded", DateTime.Now)
DataSource.InsertParameters.Add("MIMEType", MIMEType)
DataSource.InsertParameters.Add("ClassifiedId", Request.QueryString("ClassifiedId"))
Dim ImageBytes(FileUpload_Image1.PostedFile.InputStream.Length) As Byte
FileUpload_Image1.PostedFile.InputStream.Read(ImageBytes, 0, ImageBytes.Length)
DataSource.InsertParameters.Add("ImageData", ImageBytes.ToString)
Dim RowsAffected As Integer = 0
Try
RowsAffected = DataSource.Insert()
Catch ex As Exception
Response.Redirect("AddImagesProblem.aspx")
End Try
If RowsAffected <> 1 Then
Response.Redirect("AddImagesProblem.aspx")
Else
Response.Redirect("AddImagesSuccess.aspx")
End If
End Sub

View 4 Replies

Configuration :: Unspecified Error While Uploading Excel And Connecting It To Dataset

Aug 26, 2010

I am facing some problem while uploading excel sheet upload and connecting it to dataset. The Code works fine in local machine but on website its showing following error.

System.Data.OleDb.OleDbException: Unspecified error at System.Data.OleDb.OleDbConnectionInternal

Below is my code:

string FileName = Path.GetFileName(FileUpload1.PostedFile.FileName);
string Extension = Path.GetExtension(name);
string FolderPath = ConfigurationManager.AppSettings["FolderPathSMS"];
string FilePath = Server.MapPath(FolderPath + FileName);
switch (Extension)
{
case ".xls": //Excel 97-03
s = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + FilePath + ";Extended Properties='Excel 8.0;HDR={1}'";
break;
case ".xlsx": //Excel 07
s = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + FilePath + ";Extended Properties='Excel 8.0;HDR={1}'";
break;
}
EDT = new DataTable();
EDT.Columns.Add("MobileNo", typeof(string));
con = new OleDbConnection(s);
con.Open(); // I am getting the error at this point
da = new OleDbDataAdapter("select * from [Sheet1$]", con);
ds = new DataSet();
da.Fill(ds);

string FileName = Path.GetFileName(FileUpload1.PostedFile.FileName);
string Extension = Path.GetExtension(name);
string FolderPath = ConfigurationManager.AppSettings["FolderPathSMS"];
string FilePath = Server.MapPath(FolderPath + FileName);

View 2 Replies

Databases :: Uploading An Excel (.xls) File To Server And Showing It To Grid View?

Apr 25, 2010

[Code]....

i have successfully showed data using puting directpath in to a textbox(e.g, filename=TextBox1.Text;). but the code above is not working. i dont know why.

View 1 Replies

Open Excel Application On Click Of A Button Without Having Ms-excel Installed In Server

Apr 9, 2010

In my project I have to open excel application on click of a button without having ms-excel installed in server and the same case applies to word also. Please suggest me a solutions asap

View 2 Replies

Web Forms :: Aspnet_wp.exe Acquires A Lock While Aborting Uploading Excel File On Server?

May 18, 2010

I have a big excel file , and i want to upload it to server.

on upload_click , i have to do a processing which takes very long time,

because i am finding latitude and longitude from the google by reading that excel file.

and i wanted that when used click on CANCEL button the process should stop.

i have created a thread on upload_click and doing all this stuff in that thread .

when user clicks on CANCEL , i am aborting that thread.

but when user again tries to upload file , i am getting the error that file is in use .

to solve this problem i have to stop aspnet_wp.exe from task manager and have to try again .

View 1 Replies

How To Check Installed Excel Version Using Excel Application

May 25, 2010

how check installed excel version using excel application in asp.net

I created Excel object Dim oXL As Excel.Application

View 1 Replies

Databases :: Best Way To Import Data From Excel Files Into Application?

Nov 21, 2010

is there any (foc) way to import data from excel files into my application? I'm using ms visual developer express edition 2008.

View 6 Replies

Databases :: Write Data To Existing Excel Template From Application?

Apr 1, 2011

My requirement is, to open existing .xls template, write data to some specific /fixed cells to it and make it available for download.In case if I will use "Excel.Application", then at the time of deployment is it necessary that Server should have Microsoft Office installed?

View 2 Replies

Copy Data From Excel To Database?

Jan 29, 2011

How can copy the data from excel file to my database.mdf in the website's database.

View 6 Replies

Import Excel Sheet Data Into Database Using C#

Mar 15, 2010

i am developing an appilication using asp.net 3.5 with c#.net and SqlServer 2005 as backend databse. in my application i have to import the data from excel file to database table.

View 6 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved