oledb

DBF Large Char Field

。_饼干妹妹 提交于 2019-12-11 13:07:41
问题 I have a database file that I beleive was created with Clipper but can't say for sure (I have .ntx files for indexes which I understand is what Clipper uses). I am trying to create a C# application that will read this database using the System.Data.OleDB namespace. For the most part I can sucessfully read the contents of the tables there is one field that I cannot. This field called CTRLNUMS that is defined as a CHAR(750). I have read various articles found through Google searches that

File 'phd.prg' does not exists

笑着哭i 提交于 2019-12-11 12:19:11
问题 I have a visual fox pro 9 database, and i am trying to connect it from my desktop application. i can get data from almost all tables except one table. when i run query to select data from "test.dbf" it throws exception saying File 'phd.prg' does not exists i am using VFP OLEDB drivers to connect with database. DataTable YourResultSet = new DataTable(); OleDbConnection yourConnectionHandler = new OleDbConnection( "Provider=VFPOLEDB.1;Data Source=E:/TRACKONE.DBC;Exclusive=false;Nulls=false;");

Dynamically adjust Create Table and Insert Into statement based on custom class

醉酒当歌 提交于 2019-12-11 12:15:16
问题 All right, this is the bigger question linked to this link which I tried to delete but couldnt any more. People said I should never post part of the problem due to the x y problem link, which is fair enough. So here it comes. Lets say I have a class: public class CustomClass { public string Year; public double val; public string Tariff; public string ReportingGroup; } I now have some process that creates a list of this class with results (in reality its a bigger class but that shouldnt matter

How to UPDATE thousands of records in an MDB file in C#

瘦欲@ 提交于 2019-12-11 12:05:48
问题 I recently asked a question about how to insert 100,000 records in an MDB file in C#. The given answers reduced the required time from 45 secs to 10 secs. It was even possible to be reduced to 2~3 secs using Number Tables. Now I have problem updating a similar database. I don't want to actually update 100,000 records in this case but around 10,000 records from the already created MDB file with 100,1000 records. Here is my code: Stopwatch sw = new Stopwatch(); sw.Start(); OleDbConnection con =

SSIS OLEDB Command transformation (Insert if not exists)

狂风中的少年 提交于 2019-12-11 11:59:27
问题 Ok so according to Microsoft docs the OLE DB Command Transformation in SSIS does this The OLE DB Command transformation runs an SQL statement for each row in a data flow. For example, you can run an SQL statement that inserts, updates, or deletes rows in a database table. So I want to write some SQL to Insert rows in one of my tables only IF the record doesn't exists So I tried this but the controls keeps complaining of bad sintaxys IF NOT EXISTS (SELECT * FROM M_Employee_Login WHERE Column1=

Excel Jet OLE DB: Inserting a DateTime value

不羁的心 提交于 2019-12-11 11:59:23
问题 OLEDB can be used to read and write Excel sheets. Consider the following code example: using (OleDbConnection conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\my\\excel\\file.xls;Extended Properties='Excel 8.0;HDR=Yes'")) { conn.Open(); OleDbCommand cmd = new OleDbCommand("CREATE TABLE [Sheet1] ([Column1] datetime)", conn); cmd.ExecuteNonQuery(); cmd = new OleDbCommand("INSERT INTO Sheet1 VALUES (@mydate)", conn); cmd.Parameters.AddWithValue("@mydate", DateTime.Now

Parametric 'UPDATE' string running with no errors but not doing anything

[亡魂溺海] 提交于 2019-12-11 11:14:21
问题 I've recently changed an Update SQL string from dynamic SQL string to parametric SQL string . Here's what I had before: OleDbConnection conn = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + this.DBstring); OleDbCommand comm = new OleDbCommand(); comm.CommandText = "UPDATE myTable SET MY_FIELD='" + myString + "' WHERE F_SERIAL = '"+mySerial+"'"; comm.CommandType = CommandType.Text; comm.Connection = conn; conn.Open(); comm.ExecuteNonQuery(); conn.Close(); and here is

how to handle unique identifier values during SSIS import

放肆的年华 提交于 2019-12-11 11:07:34
问题 I'm trying to to import an excel file with a unique identifier column into SQL server but SSIS is giving me a lot of trouble. I can get the unique identifier values from excel into the OLE DB Destination component but i can't get them into SQL Server table. I get the error message below on trying to insert the unique identifier. NOTE: column CreatedBy is of type uniqueidentifier in the destination SQL server table. There was an error with OLE DB Destination.Inputs[OLE DB Destination Input]

When I try read Excel with OLE DB all values are empty

ぐ巨炮叔叔 提交于 2019-12-11 10:34:20
问题 I have done a little program to parser excel. It works fine only when before to execute it I open Excel file manually (is not it strange?). I.e. first I open excel file, second I execute program and I get good results If I don't open excel before to execute it I get empty values My connection string (excel file has extension .XLSX): connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;" + "Data Source=" + path + "\\" + f.Name + ";" + "Extended Properties='Excel 12.0;HDR=Yes;IMEX=1'"; My code

The requested feature is not implemented monodevelop

我的梦境 提交于 2019-12-11 10:16:30
问题 I'm trying to debug my project in MonoDevelop. I'm using the interface ADO.net. But I keep getting folowing error: The requested feature is not implemented at System.Data.OleDb.OleDbConnection.Dispose (Boolean disposing) Please help. 回答1: Mono's implementation of the OLE DB provider is not complete, since OLE DB is a native Windows API (Mono's implementation wraps the Linux libgda instead). I suggest you use a different ADO.NET provider. 来源: https://stackoverflow.com/questions/14703421/the