Insert row in Clipper .DBF with .NTX - c#

I want to insert data from a old clipper program's database using c#
the database is associated with an .ntx file.
i can insert data using vfpoledb driver to the dbf in my c# program, however, when i look at the old clipper program, the data was not there but it is in the dbf.
the culprit was the .ntx file, it needed to be reindexed so the data would be visible in the clipper program. The reindexing was done by the old program when ever i delete the .ntx files.
how can i insert data and update the .ntx files as well? the old program was not made by me but a past employee here in the company.

You'll need a third-party driver that supports the Clipper .NTX format.
Advantage Database Server from Sybase has .Net data provider, ADO and ODBC drivers that will work, and their local server is free (at least at the time I'm writing this post). The latest versions can be found here. (I'm not affiliated with them in any way; I've just done some porting of old Clipper data.)
The documentation (available both from the downloaded installations and online) contain the entire contents of a commercially published book that contains tutorials and reference materials that will help you get started.
There is a tag for Advantage here, so if you have questions regarding use you can post them using that tag. (Their Data Architect, available from the same site, will let you work with the data and indexes from an IDE as well.)

Related

How to swap existing dataset used to populate datagridview with new dataset using VS2019 C#

I've inherited a C# program written in 2012 using VS2005. My PC doesn't have the original VS2005 or more importantly Microsoft.ACE.OLDDB.12.0 data provider which was used throughout to access Excel files used to populate data grids.
I don't want to rewrite the application as I only need to change a server path hard coded into the program and I don't have much time to complete it.
I've tried downloading the required file, but it is no longer available (understandable).
I have installed the ExcelDataReader and ExcelDataReader.DataSet packages and can create datasets. I haven't been able to figure out how to swap the original datasets, which are empty as there is no provider, with my new ones.
The wizards all start from a database source, which doesn't exist.

Importing a MS-Project mpp file into C# .Net Framework and exporting the data into an SQLite database using MPXJ

**
Hello
**
I'm creating a scheduling app that takes in 2 MS-Project .mpp files (master and updated) and converts the data into SQLite tables then compares them both and displays the results and allows you to write the changes you make back to the master file. I had issues with Microsoft Interop because I don't own Microsoft Project. Is MPXJ a viable solution? The documentation I've read on it doesn't have many examples. If so how would I read it in and read it back? Were using MS-project 2016
I know nothing of MPXJ, so sorry if I overlook a more straightforward answer. It sounds to me like another way of looking at your problem is you want to:
1. Parse a MS Project file (and then do it again) and store results in memory
2. Do some data manipulation and calculations of the in-memory project data
3. Put that data into a database
I think you're stuck at step 1 because without MS Project, you lack a parser; correct? There are other ways to parse a project file. The simplest may be to have your users first convert the files to a more open format (e.g. XML) when they save them from their instances of MS Project. Lacking that, there are certainly libraries out there that can parse a Project file. Try taking a look at Gantt Project, https://sourceforge.net/projects/ganttproject/ . Being open source, you could look at that parser as a starting point; I'm not a license expert, but you may even be able to re-use the code from there.
Good luck!

C# - delete Excel-row wihout using the Interop namespace

I am searching a C# way to delete (empty) Excel-rows in a worksheet without using the Microsoft.Office.Interop.Excel namespace.
Found many examples with the Interop namespace like C# and excel deleting rows . But is there a way to do it without third-party-tools - only with the .NET?
Thank you for your help!
The options for working with Excel files relying only on standard .NET Framework namespaces is limited. Two possibilities come to mind. The first is "simplest", but only applicable if your main interest is in working with the content as a database. The second allows you to do pretty much "anything" with the Excel workbook, but the learning curve will be steep.
Both of these approaches are suited for working in a server environment (unlike those that require presence of the Excel application) and do not require any licenses.
You can use an OLE DB connection (ACE OLE DB provider) to communicate with the contents of an Excel workbook. It allows connecting to individual worksheets as well as named ranges. Basic SQL functionality is supported.
The file format of Excel 2007 and later versions is Office Open XML (OOXML). These files are "zip packages" containing the files (xml for the most part) that make up a workbook. So any standard tools that can work with Zip packages and XML can be used to open up an Excel workbook, edit the content, then close the workbook back up. In the .NET Framework, these would be the System.IO.Packaging (in WindowsBase.dll, usually needs to be referenced specifically) and System.XML namespaces.
The documentation for the file formats is the ECMA-376 standard (http://www.ecma-international.org/publications/standards/Ecma-376.htm). A useful on-line resource is openxmldeveloper.org.
Note that Microsoft also provides the Open XML SDK, a free download which can be distributed license-free with your solution. The Open XML SDK reduces the "learning curve" as it reduces the amount of knowledge you need about the OOXML file formats. I mention this for the sake of completeness, because I know how challenging trying to work directly with the file format is. Also, since the DLL is freely distributable and can be copied as part of your solution it might meet your requirements.
This stackoverflow post may help - it discusses some libraries that can manipulate excel without needing Office installed.
The question regards VB.NET but I believe the options discussed would work with C# too...
How to process excel file in vb.net without office installed

Programmatically convert SQLite to .sql

Alright, this will probably sound a bit silly. The more I think about it, the sillier it sounds.
Background:
The company I'm working for hired a guy about a year ago to write some software for them. This software (written in VB6) is for a drilling supplies manufacturer (sensors, bits, etc). Anyway, the software is installed at a rig site, and provides a plethora of information (bit depth, rpms, etc). Now, a reading is taken every 10 seconds, and saved to a file. (I was initially told a local SQL database, but that's proved incorrect.) This file, which can apparently only be opened in SQLite Database Browser (opening it in any text editor results in looking at garbage, essentially).
Move Forward:
I was hired to write a program that takes the data that is saved, and create a daily report based upon it. Initially, I was told that there was a MySQL database on the local machine that is storing the information. However, I just recently found out that that is not the case. It's stored in this file. I can open the file in SQLite Database Browser, and export it as a .sql file, and that is all awesome and such. Problem is, my employer wants this done programmatically.
My Question:
Is there a way to convert this SQLite file to .sql programmatically, or what is the best route to get this information uploaded into a local MySQL database? Thank you for much for any assistance.
Have you considered just using a [the] SQLite data provider for .NET and opening and reading the data out that way? You could easily read the data out of the SQLite database, and the write it into the MySQL database (using the appropriate MySQL data provider).
Here's the SQLite data provider I've used in the past: http://sqlite.phxsoftware.com/ I'm not sure if there's something newer (or better).
Use the SQLite Manager application you have to make an *.sql file dump of the data in the SQLite database. Import the resulting *.sql file into a MySQL database.
Write a C# script that will use this code:
sqlite_db_handler.query('SELECT * FROM dbname.sqlite_master WHERE type='table'');
To get a list of all the tables in the SQLite database.
Iterate over each of these tables and use this code:
sqlite_db_handler.query('SELECT * FROM '+table_name);
Iterate over each of the resulting rows using this code:
mysql_db_handler.query('REPLACE INTO '+table_name+' VALUES('+row.join("','")+')');
Done!
P.S.: It's pseudo-code I'm not a C# developer.

Free solution for reading/creating/updating excel files from .NET

Has to be free.
Has to support all versions of Excel files.
Has to have C# .NET API.
I need to do all of the specified actions (reading/creating/updating).
Has anyone used any library l this kind sucessfully
Update:
I read a lot of bad things about Ole DB, and Interop is not an option since this is a web application running on a server.
Try to use OleDB Reading Excel files from C#
From a previous answer on a different question:
You might consider using the Excel object model and COM interop to read the data from the Excel file into your application. Granted, this includes a dependency on Excel being installed, but it is a possibility. This article has some great code for getting started with reading Excel files in this way.
A better way might be to use a library that doesn't have a dependency on Excel being installed on the local system. This answer suggests using the Excel Data Reader library, available on CodePlex.
Like I pointed out in my other answer, there are paid third-party libraries that will likely do exactly what you are looking for. I understand you want something that is free, but in my experience with free Excel libraries, you tend to need to do a good bit of extra work to get it to play the right way.
I'm a big fan of Aspose Cells. It does all you want but it isn't free. I don't know any other products that can fit all your needs (All Excel Versions, C# Api, Read/Write, etc)

Categories