Databases :: Importing Excel Sheet Into Sql Server Table Using OleDbDataReader?
Feb 12, 2010
I am trying to Importing Excel sheet into Sql server table using OleDbDataReader
the problem is it is not fetching the cell values with contains "," (comma) ex: cell value ="03280, 03281"
i am using OleDbConnection oconn =
new
OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source="
+ Server.MapPath("Files\LineItems.xlsx") +
";Extended Properties='Excel 12.0 Xml;HDR=YES;IMEX=1';");
View 1 Replies
Similar Messages:
Jan 4, 2011
I have an C# ASP application I am writing that needs to have the capability to import a generated excel or a comma delineated sheet each day. A clerk will have this job each morning so it doesn't need to be automated. My problem in trying to understand the solution to this is that the 1 sheet contains loan information, including customer information all in the same sheet. I would like to send certain columns to update information in the loan table and send other information to update the customer table. I need it to create relationships when new loans appear in the spreadsheet.
View 1 Replies
Mar 13, 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. the fields in excel file and fields in databse table are same. i just want to import all data to that database table.
View 1 Replies
May 21, 2010
I have an excel header that has the following header title : "REMARKS (i.e. awarded etc.)"
but it seems that it can't read the cell with the brackets or it is there is a certain length of the excel header?
While reader.Read()
Dim DataRow As DataRow = dtDataTable.NewRow()
DataRow("Remarks") = Trim(reader("REMARKS i.e. awarded etc.").ToString)
dtDataTable.Rows.Add(DataRow)
End While
View 3 Replies
Sep 15, 2010
I want to copy each table(from selserver database) in separate sheet of Excel
with Sheet name different from table name..........
So the issue is that when I open Excel Sheet it show sheetname same as filename
I just want to name it as Sheet1,Sheet2 and so on
I can copy table from SqlServer(MS Sql Server 2005) into Excel Sheet as follows:
[code].....
View 2 Replies
Nov 26, 2010
I have an issue while importing the data froma customized gridview to an excel sheet .It prompts me to save the excel sheet and excel sheet is getting saved on my machine but while opening the excel sheet I am getting an error as follows and it opens as blank.Could some one tell me what the issue is.I have given the complete code to import excel sheet and error while I open it as well. In-addition to this suprisingly another issue too I have encountered when I am trying to export.
While I am trying import by clicking on Import only the datas in the CurrentPage is getting exported and remaining datas are not..I mean ..If my GridView shows 50 records at a time only these records are getting imported and remaning records are not
public static void ExportToExcel(DataTable dtFull)
{
string fileName = string.Empty;
OpenFileDialog fileDlg = new OpenFileDialog();
fileDlg.DefaultExt = "xls";
fileDlg.Filter = "Excel files (*.xls)|*.xls";
fileDlg.CheckFileExists = false;
// fileDlg.
fileDlg.Title = "Choose XLS";
if (fileDlg.ShowDialog() == DialogResult.Cancel)
return;
fileName = fileDlg.FileName;
try
{
if(System.IO.File.Exists(fileName))
{
FileStream fs = System.IO.File.OpenRead(fileName);
fs.Close();
}
}
catch
{....................
View 4 Replies
Mar 17, 2011
I am trying to insert data from excel file into sql server database table. which is working fine.. But when i tried it in table which has primaryKey As Autonumber and date as getdate(). its not inserting values in rows?
View 10 Replies
Mar 26, 2016
I am trying to import excel sheet, got an error like "
The Microsoft Jet database engine cannot open the file ''. It is already opened exclusively by another user, or you need permission to view its data"
I have given all necessary permissions but no luck..
View 1 Replies
Jan 13, 2010
I am developing a Standalone Application where i have to exprot data from sqltable to excelSheet..
View 6 Replies
Aug 17, 2010
I have an excel sheet that contains around 30,000 rows and 18 colmns. These no of rows and columns may increase in future. I need to read all these records from excel sheet and insert into a table in sql database. For reading the excel book I am using Oledbconnections. The possible solutions I have known as per my knowledge, to insert the data are
1. To insert one record at a time which makes 30,000 database hits. How will this affect the performance?
2. To use liked servers - bu this is not working for me.I do not have database permissions to use linked servers. So, the only option i have is the first one.
View 2 Replies
Feb 1, 2010
i have an aspx page which has a fileuploader and a button
initially i have to browse the file and after browsing the file i have to check the extension if the extension is xsl or xslx then only i have to enable the submit button
once the submit button is enabled i have to insert this data into the table
and i have to display the number of succesfully inserted rows and no of unsuccessfull insertions .
success and failure is dependent on the mismatch of the datatype between the excel sheet and the database column
i am coding in c# but am unable to upload.
View 2 Replies
Mar 1, 2011
I receive the error message "Could not find installable ISAM." When I try to open an Excel file in my C# code behind of an aspx page. The code is:
[code]...
View 16 Replies
Sep 28, 2010
I want to fetch data from a excel sheet. Can anyone tell me how we can acheive this I also want to edit that data and then again place it on excel sheet.
View 6 Replies
Jan 6, 2010
i want to find data from excel sheet using c# my excel sheet like this
Sr. No.
Store Code
Store Name
City
State
1
3062
C.G.Road.
Ahmedabad
Gujarat
2
3103
Iscon Mega Mall 2
Rajkot
Gujarat
3
3113
New Gandhi Nagar
Ghaziabad
Delhi
4........................
View 3 Replies
Aug 30, 2010
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.
View 1 Replies
Jul 7, 2010
I want to create a application which can be able to read data from excel sheet and process and print it.
View 3 Replies
Aug 20, 2010
I have write the code for deleting the data in excel sheet. but we have got the error" Deleting data in a linked table is not supported by this ISAM."
below I paste some code snippest.
string strDelete = "Delete from [" + strSheetName + "$]";
cmdExcel.Connection = con;
cmdExcel.CommandType = CommandType.Text;
cmdExcel.CommandText = strDelete;
cmdExcel.ExecuteNonQuery();
View 2 Replies
Aug 19, 2010
I have write the code for deleting the data in excel sheet. but we have got the error" Deleting data in a linked table is not supported by this ISAM." below I paste some code snippest.
string strDelete = "Delete from [" + strSheetName + "$]";
cmdExcel.Connection = con;
cmdExcel.CommandType = CommandType.Text;
cmdExcel.CommandText = strDelete;
cmdExcel.ExecuteNonQuery();
View 1 Replies
Aug 7, 2010
i got the different datatable value using different query.Now i want to export to excel at the single sheet like datatable1 to sheet1 and datatable2 to sheet2 .
View 6 Replies
Oct 26, 2010
I have a excel sheet and I want to make the 2nd row my header column and read the data from the 3rd row, considering 2nd row is the Column name.
View 1 Replies
Mar 3, 2011
I have the following code i found online and it works fine as long as the sheet names are simple names it seems..
If i have a excel file with a sheet name of (sheet1) the code works.. but if i have a file with a sheet name like (FileName2011_03_03_15_01_43) it fails and causes the rest of my code not work..
[Code]....
View 3 Replies
Nov 9, 2010
I didn know where to post this query so m posting it here
I am tryin to export the data from d database to an excel sheet m using d following stored procedure for this
[Code]....
BlogAssignment being my database name and Data_Table my table.
Trial.xls is the excel sheet where i am trying to insert the data.
I am getting the follwoing error
[Code]....
View 2 Replies
Jan 29, 2011
i have made a connection and retrieve the data from the excel sheet. however when i run a query to update or insert some data into excel sheet it will generate an error "Cannot expand named range"
View 2 Replies
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
Jul 5, 2010
I have software for STOCK and SALES that can give me an Excel price list, I wanna write a small web app that will enable users to check prices, I don't have any access to that software's database, so I wanna import that Excel data (one worksheet, 5 columns, almost 10000 rows) into an MS SQL database table, keep in mind that the price list will change few time a month so I need to re-import that price list once its been updated.
or maybe I should skip using an MS SQL database and directly use the Excel sheet? if so, then how?!
View 2 Replies