HotDog's Blog

Hotdog (Robert Verpalen) about C# and vb.net

This blog hosted by:
http://blogs.vbcity.com      
  Home :: Syndication  :: Login

JunJuly 2008Aug
SMTWTFS
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789

Articles

Archives

Topics

CONTACT

Fun but useful linkies

General

VS 2005

Wolfenstein ET

This class is a wrapper round an oledb connection to FoxPro. Don't know if there's much need for one, but I've had need for it on several occasions allready ;-)
FoxPro needs a set of specific tweaks to make it work with the default bindings and especially if you want to update, simply using the default data adapter won't work out of the box.
The class uses the default .net OleDB providers, but the machine the code is used on will need to have the FoxPro provider installed. The VFPOLEDB can be downloaded from http://www.microsoft.com/downloads/details.aspx?FamilyId=E1A87D8F-2D58-491F-A0FA-95A3289C5FD4&displaylang=en


The code of the connection class: Source Code

Usage is straight forward, create a connection. For example to connect to a folder:
FoxProConnection conn = new FoxProConnection(”c:\yourdatabasefolder”);

Of course instead of the folder, you can also use a dbc file. To get data out of an sql string, you can simply use the GetData commands. These will return a QueryResult object rather than the table directly. The advantage of this, is that you can use that object to update later on. If you don't need it, simply read out the Table property to get the table. Example:
conn.GetData(”select * from DbfName”);

To update, you have the choice to use the UpdateData method of the connection object, or to use the returned QueryResult object to update. An example of the latter:
QueryResult data = conn.GetData(”select * from table1”);
//you could also .net binding, for example: DataGridView1.DataSource =data;
//...some edits to the data.Table here
data.Update();

The above will work fine if the table has got a primary key set. In case it has not, you'll have to indicate which field(s) is the primary. This can also be doen with the queryresult object.
For example, using the data object from above and table1 having a field named “table1_key”, before the first update, set the keyfield:
data.SetKeyField(”table1_key”);

posted on Thursday, February 08, 2007 2:43 PM

Feedback

# re: FoxPro connection 5/31/2007 3:39 AM cash advance
cash

# re: FoxPro connection 5/31/2007 3:40 AM hoodia
hoodia

# re: FoxPro connection 5/31/2007 3:42 AM rolex replica
rolex

# re: FoxPro connection 5/31/2007 3:42 AM ringtones
free

# re: FoxPro connection 5/31/2007 3:43 AM rolex replica
rolex

# re: FoxPro connection 7/19/2007 2:21 PM Car Insurance
Car Insurance rates

# re: FoxPro connection 7/19/2007 2:22 PM Mapquest usa
hello

# re: FoxPro connection 8/16/2007 12:34 PM free ringtones
thanks

# re: FoxPro connection 8/16/2007 12:34 PM ringtone
nice place!

# re: FoxPro connection 8/31/2007 9:40 AM Aron
http://75ijhusaerg.cn/c/29
http://lopnrtuibovbsd.cn/c/88
http://erobnjgiasd6.cn/c/54
http://lopertqawe67g.cn/c/18
http://zxkortunfgsd.cn/c/27
http://dareopnrtvb.cn/c/70
http://kazelttop.cn/c/62
http://956inbdf4er.cn/c/15
http://1ni86jgnxjhof.cn/c/94
http://nlaspoinrerp.cn/c/72
http://09fneropobna.cn/c/97
http://98eruyvabje.cn/c/98
http://kotiohbdfawery.cn/c/23
http://motrnlfs5tero.cn/c/79
http://njbgf856hof.cn/c/64
http://pprerehbnsdfd.cn/c/96
http://loretypoasde4.cn/c/92
http://55kojirearvf.cn/c/11
http://ndersapprew4.cn/c/82">http://ndersapprew4.cn/c/82
http://ponrtubndsd.cn/c/81
http://farel09nfegd.cn/c/26
http://mohyfrwepovva15.cn/c/72
http://kotiohbdfawery.cn/c/6
http://nreryoopbser.cn/c/27
http://mmi85udaweyb.cn/c/73
http://956inbdf4er.cn/c/81
http://mohyfrwepovva15.cn/c/23
http://ndersapprew4.cn/c/8
http://laseibnkf8.cn/c/70
http://as49nfdfhf.cn/c/99
http://mohyfrwepovva15.cn/c/18
http://lopnrtuibovbsd.cn/c/73
http://motrnlfs5tero.cn/c/55
http://voretinaser87.cn/c/75
http://pity8bnjfgsd.cn/c/57
http://mmi85udaweyb.cn/c/100
http://75ijhusaerg.cn/c/92
http://njbgf856hof.cn/c/39

# re: viagra 9/5/2007 5:17 AM viagra
Viagra is proved to be the best friend of men suffering from impotency. With http://www.viagraforce.com viagra curing millions from the shackles of erectile dysfunction, an inseparable bond of trust has grown up between http://www.viagraforce.com/viagra_n_men.html viagra and men. However, when erectile dysfunction afflicted men across the world have got back their capability to sexually satisfy their women a similar bond of reliance has also started to develop between http://www.viagraforce.com/viagra_n_women.html viagra and women. And finally, http://www.viagraforce.com/viagra_n_couples.html viagra and couples have become the best of buddies.

# re: FoxPro connection 9/12/2007 6:56 AM kisi
The above will work fine if the table has got a primary key set. In case it has not, you'll have to indicate which field(s) is the primary

# re: FoxPro connection 9/25/2007 2:08 PM karty sd
Interesting article!
Thanks

# re: FoxPro connection 10/8/2007 4:49 PM asa
http://matura-italiana-hard.pornografici-bmp.info
http://topa-calore.pornografici-bmp.info
http://video-tetta-gratis.guido-bmp.info
http://gratis-galleria-video-nera-hard.decesare-bmp.info
http://porcavacca-mature-gratis.culetto-bmp.info
http://perizomi-hard.pornografici-bmp.info
http://parisi-hilton-video-free.supercoppia-bmp.info
http://video-troia-mature.supercoppia-bmp.info
http://anteprima-video-infermiere.supercoppia-bmp.info
http://figa-calda-quarantenne.pornografici-bmp.info
http://orgia-lesbica-nera.culetto-bmp.info
http://www-belle-chiappeorg.supercoppia-bmp.info
http://cazzo-figa-culo-scopare.guido-bmp.info
http://foto-pompino-spiaggia.culetto-bmp.info
http://nuvola-nera-dvd-vhs-hard.decesare-bmp.info
http://gnocca-vergine.guido-bmp.info
http://spiata-amatoriale-gratis.decesare-bmp.info
http://sesso-pene-fica.decesare-bmp.info
http://mega-poppa.supercoppia-bmp.info
http://mutandina-bagnata.supercoppia-bmp.info
http://circolo-delle-sega.culetto-bmp.info
http://amatoriale-sexi.pornografici-bmp.info
http://donna-nuda-gratis-famosa.culetto-bmp.info
http://grassone-vogliose.guido-bmp.info
http://pompini-fatte-da-donne-anziane.supercoppia-bmp.info
http://video-anteprime-scopate.guido-bmp.info
http://guardoni-foto-gratis.pornografici-bmp.info
http://peloso-uomo.pornografici-bmp.info
http://coppie-vogliose.pornografici-bmp.info
http://cazzo-in-culo-con-photo-gradis.culetto-bmp.info

# re: FoxPro connection 10/22/2007 9:19 AM Novie Amilia
Hah, so it's quite easy to create FoxPro connection. Thanks.

# re: FoxPro connection 12/6/2007 12:37 AM Sd card
It’s very good article. Great site with very good look and perfect information.


# re: FoxPro connection 12/9/2007 9:55 AM free ringtones
We offer the largest collection of polyphonic ringtones, monophonic ringtones, mobile videos, color wallpapers, color screensavers, real sounds.

# re: FoxPro connection 12/24/2007 11:48 AM Replica Watch
If you are looking for the replica watch and information about it, you came to the right place.

# re: FoxPro connection 2/27/2008 4:26 AM dizi izle
Thanks for this really useful article.Great cheat sheet, I appreciate it very much.

# re: FoxPro connection 4/13/2008 2:25 AM Kleidung
Thanks for very interesting article. btw. I really enjoyed reading all of your postsabout <a href="http://www.kosnix.de">Klamotten </a>. It's interesting to read ideas about your stuff and <a href="http://www.kosnix.de">Kleidung </a>, and observations from someone else's point of view… makes you think more. Read more about <a href="http://www.pattern-crochet.com/">Pattern </a> and <a href="http://www.pattern-crochet.com/">Crochet </a><br>
<br>
Visit my <a href="http://www.fitness-am.de">Bodybuilding Muskelaufbau </a> Shop . Best regards! <a href="http://www.schwule-gays.net">Schwule</a> - <a href="http://www.schwule-gays.net">Gays

# re: FoxPro connection 4/16/2008 12:24 AM Cialis
Cialis is a revolutionary drug used to treat Erectile Dysfunction. Cialis stays in the
system for up to 24 hours and with fewer side effects.It is now available for sale in the US market.
http://www.impotencehealthcenter.com

# re: FoxPro connection 5/21/2008 12:15 AM Viagra
Viagra is prescribed to treat erectile dysfunction (ED).If you take any medicines that have nitratesin them (like

nitroglycerin for chest pain)—every day or even once in a while—you should NOT take VIAGRA.Discuss your general

health status with your doctor to ensure that you are healthy enough to engage in sexual activity. If you

experience chest pain, nausea, or any other discomforts during sex, seek immediate medical help.Although erections

lasting for more than 4 hours may occur rarely with all ED treatments in this drug class, to avoid long-term

injuries, it is important to seek immediate medical help.http://www.starpills.com

# re: FoxPro connection 6/12/2008 1:23 AM DNA Test
Who´s programming with FoxPro nowadays?

Post Feedback

Title:
Name:
Url:
Comments: 
Protected by Clearscreen.SharpHIPEnter the code you see: