TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Patrick Grindstaff
NA
6
0
Connect to dBase with C#
Apr 8 2006 5:13 PM
Over the past few days I have been working on an application that iterates through dBase files and outputs the information in a listbox or datagrid. I seem to have gotten the connection string right as I don't get an error when I open the dbf file, but, whenever I add in the DataAdapter and DataSet I get an error. It might help to know that I am using VS .NET 2005 and I am trying to connect to the dBase files using ODBC. Below is the code I am using and an image of the error I get. Code: OdbcConnection conn = new OdbcConnection(); conn.ConnectionString = ("Driver={Microsoft dBASE Driver (*.dbf)};DriverID=21;Dbq=I:\\MDT_1.4\\;"); try { // Open Drawing Database conn.Open(); // Query string jobData = "SELECT DWG_NAME, DWG_NUMBER FROM DRAWINGS.dbf"; OdbcCommand cmd = new OdbcCommand(); cmd.CommandText = (jobData); OdbcDataAdapter dbAdapter = new OdbcDataAdapter(jobData, conn); //<---Error begins here (I think) DataSet dtSet = new DataSet(); dbAdapter.Fill(dtSet); DataTable dbTable = dtSet.Tables[0]; foreach (DataRow dbRow in dbTable.Rows) { outputListBox.Items.Add(dbRow["DWG_NAME"].ToString()); }
Reply
Answers (
0
)
1-D array has the reference of a 2-D array on it's each index and then 2-D array has a 1-D array on it's each location
Import dll error