oledbconnection

What is causing my OLEDbException, IErrorInfo.GetDescription failed with E_FAIL(0x80004005)

家住魔仙堡 提交于 2019-11-27 23:47:47
I am using an OleDbConnection, OldDbCommand, and OleDbReader against an Access database. I have a named query in the database which I am calling from the code. The query works correctly when it is ran from access. Several resources indicate the error could be caused by using reserved words in the query and to wrap them with brackets. I am not using any reserved words and have wrapped all column names in brackets anyway to rule it out. Trying to determine where the problem is, I have simplified the query to a simple SELECT id FROM table1 WHERE id = 5 which the Ole connection does not throw an

Excel cell-values are truncated by OLEDB-provider

戏子无情 提交于 2019-11-27 14:04:10
I'm using the OleDbConnection class to retrieve data from an Excel 2000/2003 workbook: string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + filename + ";" + "Extended Properties=\"Excel 8.0;IMEX=1\";"; OleDbConnection connection = new OleDbConnection(connectionString); connection.Open(); // code to get table name from schema omitted var dataAdapter = new OleDbDataAdapter(string.Format("SELECT * FROM [{0}]", name),connection); var myDataSet = new DataSet(); dataAdapter.Fill(myDataSet, "ExcelInfo"); Now it turns out that cells in the worksheet with length greater than

JSON.net serialize directly from oledbconnection

混江龙づ霸主 提交于 2019-11-27 02:12:42
I currently have a handler which takes the filepath and tabname for an excel file, processes the file into a datatable and then serializes the table into a json string to return. This is working until I try to process large file, and then I get an out of memory exception. I was thinking that it would reduce the memory usage if I didn't load everything into the datatable first, and instead loaded straight into the json string. However, I have been unable to find any examples of how to do this. Can I serialize directly from the OleDbConnection into a string? How? public void ProcessRequest

What is causing my OLEDbException, IErrorInfo.GetDescription failed with E_FAIL(0x80004005)

微笑、不失礼 提交于 2019-11-26 23:20:54
问题 I am using an OleDbConnection, OldDbCommand, and OleDbReader against an Access database. I have a named query in the database which I am calling from the code. The query works correctly when it is ran from access. Several resources indicate the error could be caused by using reserved words in the query and to wrap them with brackets. I am not using any reserved words and have wrapped all column names in brackets anyway to rule it out. Trying to determine where the problem is, I have

OLEDB connection to Access Database (accdb)

无人久伴 提交于 2019-11-26 20:57:18
问题 I want to make a simple application for an exercise, so it could be nice to connect to a simple database like Access (.accdb) My program looks like this: using System; using System.Collections.Generic; using System.Data; using System.Data.OleDb; using System.Linq; using System.Web; namespace myProject.Account { public class DbManager { private OleDbConnection _dbConnection; public void OpenDbConnection() { _dbConnection = new OleDbConnection {ConnectionString = GetConnectionString()}; }

Help with a OleDB connection string for excel files

…衆ロ難τιáo~ 提交于 2019-11-26 20:26:40
The problem i'm having is that the data adapter is looking at only the first row in each column to determine the data type. In my case the first column "SKU" is numbers for the first 500 rows then I happen to have SKU's which are mixed numbers and letters. So what ends up happening is rows in the SKU column are left blank, but I still get the other information for each column row. I believe it is the connection string that controls that and with my current settings it should work, however it is not. Connection String: conn.ConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:

Excel cell-values are truncated by OLEDB-provider

巧了我就是萌 提交于 2019-11-26 18:22:12
问题 I'm using the OleDbConnection class to retrieve data from an Excel 2000/2003 workbook: string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + filename + ";" + "Extended Properties=\"Excel 8.0;IMEX=1\";"; OleDbConnection connection = new OleDbConnection(connectionString); connection.Open(); // code to get table name from schema omitted var dataAdapter = new OleDbDataAdapter(string.Format("SELECT * FROM [{0}]", name),connection); var myDataSet = new DataSet();

Parsing CSV using OleDb using C#

吃可爱长大的小学妹 提交于 2019-11-26 16:32:50
I know this topic is done to death but I am at wits end. I need to parse a csv. It's a pretty average CSV and the parsing logic has been written using OleDB by another developer who swore that it work before he went on vacation :) CSV sample: Dispatch Date,Master Tape,Master Time Code,Material ID,Channel,Title,Version,Duration,Language,Producer,Edit Date,Packaging,1 st TX,Last TX,Usage,S&P Rating,Comments,Replace,Event TX Date,Alternate Title ,a,b,c,d,e,f,g,h,,i,,j,k,,l,m,,n, The problem I have is that I get various errors depending on the connection string I try. when I try the connection

JSON.net serialize directly from oledbconnection

荒凉一梦 提交于 2019-11-26 10:00:56
问题 I currently have a handler which takes the filepath and tabname for an excel file, processes the file into a datatable and then serializes the table into a json string to return. This is working until I try to process large file, and then I get an out of memory exception. I was thinking that it would reduce the memory usage if I didn\'t load everything into the datatable first, and instead loaded straight into the json string. However, I have been unable to find any examples of how to do this

Help with a OleDB connection string for excel files

China☆狼群 提交于 2019-11-26 09:03:32
问题 The problem i\'m having is that the data adapter is looking at only the first row in each column to determine the data type. In my case the first column \"SKU\" is numbers for the first 500 rows then I happen to have SKU\'s which are mixed numbers and letters. So what ends up happening is rows in the SKU column are left blank, but I still get the other information for each column row. I believe it is the connection string that controls that and with my current settings it should work, however