oledb

How to specify the delimiter when importing CSV files via OLEDB in C#

廉价感情. 提交于 2019-11-26 16:55:54
问题 I need to perform a complex import in a Microsoft SQL Server 2000. Since doing it in a DTS is too complicated, I'm trying to do it with a little C# program, but I'm having problems when I need to import a CSV files: this file is using semicolons as field delimiters instead of commas and I can't get the .NET's OLE DB provider to recognize it. I already found various "solutions" on the net like using Extended Properties="Text; Format=Delimited" or ``Extended Properties="Text; Format=Delimited(;

what is the difference between OLE DB and ODBC data sources?

左心房为你撑大大i 提交于 2019-11-26 16:54:07
I was reading a MS Excel help article about pivotcache and wonder what they mean by OLE DB and ODBC sources ...You should use the CommandText property instead of the SQL property, which now exists primarily for compatibility with earlier versions of Microsoft Excel. If you use both properties, the CommandText property’s value takes precedence. For OLE DB sources , the CommandType property describes the value of the CommandText property. For ODBC sources , the CommandText property functions exactly like the SQL property, and setting the property causes the data to be refreshed... I really

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

Searching values via a datagridview

有些话、适合烂在心里 提交于 2019-11-26 15:33:17
i am try to search for a specific value in a database by entering text into a textbox and then using SQL to query the database and then display results in the datagridview. here is the code: Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtSearch.TextChanged Connection.Open() Dim dataTable As New DataTable Dim dataSet As New DataSet dataSet.Tables.Add(dataTable) Dim dataAdapter As New OleDbDataAdapter Dim SQLQuery As String SQLQuery = <sql> SELECT * FROM Students WHERE StudentFirstName = @StudentFirstName </sql> .Value dataAdapter = New

Missing library to reference OLEDB connection types

别说谁变了你拦得住时间么 提交于 2019-11-26 14:55:52
问题 I got the following piece of code from SSIS Team Blog to cast the OLEDB connection type so that it can be used by the AcquireConnection () method. Now I am not sure why the Dts.Connections part is not working. I dont know the library that I would have to add to make it work. I pretty much added the most important ones including the Dts.RuntimeWrap. Please let me know if you need more information on the question. ConnectionManager cm = Dts.Connections["oledb"]; Microsoft.SqlServer.Dts.Runtime

When reading a CSV file using a DataReader and the OLEDB Jet data provider, how can I control column data types?

可紊 提交于 2019-11-26 12:44:18
问题 In my C# application I am using the Microsoft Jet OLEDB data provider to read a CSV file. The connection string looks like this: Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\Data;Extended Properties=\"text;HDR=Yes;FMT=Delimited I open an ADO.NET OleDbConnection using that connection string and select all the rows from the CSV file with the command: select * from Data.csv When I open an OleDbDataReader and examine the data types of the columns it returns, I find that something in the stack

Could not find installable ISAM

心已入冬 提交于 2019-11-26 12:17:41
问题 I have the following code : string excelConnectionString = @\"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\\db\\suc.xls; Extended Properties=\"\"Excel 12.0;HDR=YES;\"\"\"; // Create Connection to Excel Workbook using (OleDbConnection connection = new OleDbConnection(excelConnectionString)) { OleDbCommand command = new OleDbCommand (\"Select * FROM [Sheet1$]\", connection); connection.Open(); and i get the following error : Could not find installable ISAM. at connection.Open() . Any ideas

Using Excel OleDb to get sheet names IN SHEET ORDER

本秂侑毒 提交于 2019-11-26 11:11:17
I'm using OleDb to read from an excel workbook with many sheets. I need to read the sheet names, but I need them in the order they are defined in the spreadsheet; so If I have a file that looks like this; |_____|_____|____|____|____|____|____|____|____| |_____|_____|____|____|____|____|____|____|____| |_____|_____|____|____|____|____|____|____|____| \__GERMANY__/\__UK__/\__IRELAND__/ Then I need to get the dictionary 1="GERMANY", 2="UK", 3="IRELAND" I've tried using OleDbConnection.GetOleDbSchemaTable() , and that gives me the list of names, but it alphabetically sorts them. The alpha-sort

Optimal way to Read an Excel file (.xls/.xlsx)

倾然丶 夕夏残阳落幕 提交于 2019-11-26 09:17:30
问题 I know that there are different ways to read an Excel file: Iterop Oledb Open Xml SDK Compatibility is not a question because the program will be executed in a controlled environment. My Requirement : Read a file to a DataTable / CUstom Entitie s (I don\'t know how to make dynamic properties/fields to an object[column names will be variating in an Excel file]) Use DataTable/Custom Entities to perform some operations using its data. Update DataTable with the results of the operations Write it

VBScript & Access MDB - 800A0E7A - “Provider cannot be found. It may not be properly installed”

纵饮孤独 提交于 2019-11-26 09:12:36
问题 I\'ve having a problem with a VBScript connecting to an access MDB Database. My platform is Vista64, but the majority of resources out there are for ASP/IIS7. Quite simply, I can\'t get it to connect. I\'m getting the following error: 800A0E7A - \"Provider cannot be found. It may not be properly installed\" My code is: Set conn = CreateObject(\"ADODB.Connection\") strConnect = \"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\database.MDB\" conn.Open strConnect So far I have ran %WINDIR%\