CFanatic

Go Back   CFanatic > Programming > C# Programming

Join CFanatic Forum Now

Database connection issue topic posted under C# Programming which is a part of Programming category in CFanatic Forum
Reply
 
Thread Tools Display Modes
  #1  
Old 09-08-2010, 01:01 PM
Junior Member
 
Join Date: Sep 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
WileeDarklight is on a distinguished road
| More
Database connection issue

Hey all!

I'm rather new to connecting to external sources so bear with me. The error I'm getting is that "No data exists for the row/column."

the code in question:

String ConnectionString;
ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source = C:\\Users;Extended Properties =dBase IV;";
System.Data.OleDb.OleDbConnection dBaseConnection;
dBaseConnection = new System.Data.OleDb.OleDbConnection(ConnectionString );
dBaseConnection.Open();
System.Data.OleDb.OleDbCommand dBaseCommand;
dBaseCommand = new System.Data.OleDb.OleDbCommand("SELECT FPHONE FROM ADDRESS", dBaseConnection);
System.Data.OleDb.OleDbDataReader dBaseDataReader;
dBaseDataReader = dBaseCommand.ExecuteReader(CommandBehavior.Sequent ialAccess);

txtFaxNum.Text = dBaseDataReader.GetValue(0).ToString();


The full data source is in that format (meaning seperated with \\ ) and the coloumn name is correct and that is the name of the table. Can anyone tell me what I'm doing wrong?
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Check if the connection is still open... Krstevski C# Programming 0 09-03-2010 12:57 AM
Server connection problem Frederick Lupien C# Programming 0 08-30-2010 06:17 PM
how to check internet connection Hystrio MFC Programming 1 07-24-2008 11:58 PM
MFC SDI with ODBC Connection gaurav0381 MFC Programming 8 02-26-2008 05:45 AM
connection to server in mfc suresh vaikuntam Introduce yourself 0 09-12-2007 09:08 AM

 

Advertisement

CFanatic Search
Custom Search

Advertisement

All times are GMT -5. The time now is 03:55 PM.



Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO ©2010, Crawlability, Inc.
Cfanatic.com is a premier member of the IDG TechNetwork. For advertising opportunities contact here
Get Paid for Working on Projects Matching Your Expertise at Go4Expert's Jobs Board