|
|
|
|
|
|
|
Page Views :
|
33054
|
|
Downloads :
|
2000
|
|
Rating :
|
Rate it
|
|
Level :
|
Intermediate
|
|
|
|
|
Download
Files:
|
|
|
|
|
|
|
|
|
|
|
Overview
I've removed the dust to some code that Ive used a while ago for access FoxPro database files (DBFs and Idxs) from C++, in a manner compatible with FoxPro 2.6.
To use DBF files in .NET, I have written a wrapper that allows you to access DBFs directly from C# or VB.NET without using ODBC or ADO.NET.
This library only handles DBFs and normal Idxs. Unfortunately, it doesn't handler memos or Cdxs or compact Idxs.
The library handles shared access over the network using locking and unlocking mechanism. Some other features of the library are database table creation, cursor creation, index creation or recreation and so on.
To use this library, you can unzip attached xBaseEngineRFV.zip into a working directory, open db solution under Visual Studio and Build Solution. This solution includes 2 projects:
- The engine DLL project, that make db.dll that you can add to any C# or VB.NET project.
- A test program written in C#. This program uses some of the functionality of the engine.
Description
It is complicated to build a DBF engine without the services of expression evaluator, internal functions, memory variable manager and so on. But this engine gives you all tools that you would need for utilizing DBF files on the network.
The best way to learn and use the engine is look at the example code that ships with this solution. In resume, you cant:
- Construct one or more objects based on xdbf class. At this time, the object not represent any database, is only a container.
- Open a database. You can open an existing dbf (utilizing .Use() method), or create a new one (using CreaTable() or CreaCursor() methods).
- If you need, attach existing indexes (using SetIndex() methods) or create new ones (using IndexOn() methods).
- Manipulate databases. You can add new records (using AppendBlank() method), get field data (using Get() method) or replace data (using Replace() method). You can test for end of file condition (using Eof property) or begin of file condition (using Bof property). You can delete records (using Delete() method), or know the count of records (using RecCount property) or the deleted status of a record (using Delete property).
- Navigate through database, utilizing sequential search (using Locate() method), indexed search (using SetOrder() and/or Seek() methods), absolute positioning (using Go() method) or relative positioning (using Skip() method).
- If you are utilizing shared databases, you can lock or unlock records (using Lock() method). Engine perform automatic locking before replace, with auto refresh of record information.
- You can set relations between open databases (using SetRelation()).
- Close databases. The close is performed automatically when the container object is destroyed.
There are more methods and properties available. Some of the methods you can use to utilize to request fields types, fields sizes and so on. Try it!!!
|
|
Comment Request!
Thank you for reading this post. Please post your feedback, question, or comments about this post
Here.
|
|
|
|
|
Login
to add your contents and source code to this article
|
|
|
|
|
|
|
|
|
|
|
|
Ricardo Federico
My name is Ricardo Federico Villafañes, I’m Electronic Engineer and live in Argentina. I start coding near 1990, and I've utilized basic, c, c++, fox languages. I’ve started C# 4 month ago. Actually, I’m working for a chain of supermarkets.
|
|
|
|
|
|
|
|
|
C# Consulting is founded in 2002 by the founders of C# Corner. Unlike a traditional
consulting company, our consultants are well-known experts in .NET and many of them
are MVPs, authors, and trainers. We specialize in Microsoft .NET development and
utilize Agile Development and Extreme Programming practices to provide fast pace
quick turnaround results. Our software development model is a mix of Agile Development,
traditional SDLC, and Waterfall models.
|
|
Click here to learn more about C# Consulting. |
|
|
|
|
|
|
|
Introducing MaxV - one click. infinite control. Hyper-V Hosting from MaximumASP.
Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon.
Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees.
As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
|
Dynamic PDF
ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications.
|
Nevron Chart for .NET 2010.1 Now Available
The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
|
ASP.NET 4 Hosting
Get 2 Months Free of ASP.NET Hosting for Only $4.95/month! Receive FREE MS SQL and MySQL Databases Including ASP.NET 4/3.5, MVC 3.0, Silverlight 4, Windows 2008/IIS 7.0 Plus FREE IIS 7 Modules. Host UNLIMITED ASP.NET Web Sites – Click Here!
|
|
|
|
|
|
|
|
|
|
|
|
|