[Webinar] Streamline your web hosting managementRegister Today


display data in datagridview form dbf file

Posted on 2009-02-09
Medium Priority
Last Modified: 2013-11-18

VSexpress 2008 VB

I create datagridview1  in form1 and I want to display data from fox database file dbf in this datagridview

file is on P:\PROGRAMS\Ex\y2008

I'm beginner and know that this code is wrong but this is what i get searching in google and experts exchange

thanks in advance

Dim con As New OleDbConnection("Provider=SQLOLEDB;Data Source=P:\PROGRAMS\Ex\y2008 ;Extended Properties=dBASE IV;User ID=ccc;Password=hhh;")
        Dim da As New OleDb.OleDbDataAdapter()
        da.InsertCommand = New OleDbCommand("hgascalcstored", con)
        With da.InsertCommand
            .CommandType = CommandType.Text
            da.InsertCommand.CommandText = "use invprn"
            da.InsertCommand.CommandText = "browse"
end sub

Open in new window

Question by:gowerman
LVL 14

Accepted Solution

tusharkanvinde earned 200 total points
ID: 23589911
Is this a visual foxpro or a dBase database file. For Visual Foxpro, the provider should be VFPOLEDB and not SQLOLEDB. Also username and password is not implemented in VFP.

Author Comment

ID: 23590732
ok I change that but still have error on line


I think with this command i don't get data from database but just display  browse

problem is i dont know what is command to retrieve  data
LVL 12

Expert Comment

ID: 23591387
If you are looking for code/syntax for   VSexpress 2008 VB   then you are posting your question to the wrong forum.    

Once you get the FP/VFP data it is up to that language's command set to display the data.

This is a forum for Foxpro/Visual Foxpro - not  VSexpress 2008 VB

Perhaps you should post your question to a forum dealing with that language.

Good Luck


Author Comment

ID: 23598126
ok I will post that to VS express
I'm beginner but when i was connected to sql then after i use sql command to get data
I connect to server no i dont know how to display this data in datagridview

Expert Comment

ID: 24191260
The below attached code will connect to your dbf file and give a message data from your dbf first col.

Make necessary changes at your end like path and file name and link your form with recordset etc and try .

Best of luck ....

Bm keshav


Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Ranking ecommerce websites is a vital process. You need to have a strong SEO (Search Engine Optimization) strategy. If you don’t have one, you are losing out on brand impressions, clicks and sales. Check this guide on how to improve website traffic …
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…
Suggested Courses
Course of the Month7 days, 18 hours left to enroll

608 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question