Geeks Talk

Prepare for your Next Interview


Welcome to the Geeks Talk forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

db connectivity

This is a discussion on db connectivity within the C# forums, part of the Software Development category; Hi i have three fields emp name empid emp dept now i want to connect to acess db and want to populate the db with new records...

Go Back   Geeks Talk > Software Development > C#
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read
  #1 (permalink)  
Old 11-06-2007
Junior Member
 
Join Date: Sep 2007
Location: Hydrabad
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
rajshekhar.das is on a distinguished road
db connectivity

Hi
i have three fields
emp name
empid
emp dept
now i want to connect to acess db and want to populate the db with new records
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 11-06-2007
Moderator
 
Join Date: Jun 2007
Location: Bangalore,India
Posts: 1,853
Thanks: 9
Thanked 168 Times in 142 Posts
debasisdas has a spectacular aura aboutdebasisdas has a spectacular aura about
Re: db connectivity

So whats the problem then ?
Reply With Quote
  #3 (permalink)  
Old 01-14-2008
Junior Member
 
Join Date: Sep 2007
Location: Delhi
Posts: 8
Thanks: 1
Thanked 0 Times in 0 Posts
deepakk87 is on a distinguished road
Re: db connectivity

It is similar to any other DBMS like SQL.
Use ODBCConnection and OdbcReader .In Connection String= ";dbq="Pathname of file;dsn=access files ";
Reply With Quote
  #4 (permalink)  
Old 03-24-2008
Junior Member
 
Join Date: Jan 2007
Location: Chennai
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
a_sahayam_811572 is on a distinguished road
Re: db connectivity

see the sample below,

string dbConnString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Temp\test.mdb";
OleDbConnection dbConn = new OleDbConnection(dbConnString);
OleDbCommand dbCommand = new OleDbCommand();
dbCommand.Connection = dbConn;
dbConn.Open();

dbCommand.CommandType = CommandType.Text;
dbCommand.CommandText = "Select * from Employee";
OleDbDataReader dr = dbCommand.ExecuteReader();
while (dr.Read() == true)
{
Console.WriteLine(dr["uid"].ToString() + ":"+ dr["uname"].ToString() + ":" + dr["udept"].ToString());
}
dbConn.Close();
Reply With Quote
Reply

  Geeks Talk > Software Development > C#

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 On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Connectivity in java with oracle anuj.rawat Java 1 09-10-2007 05:13 AM
Methods and process of data connectivity manishvas22 Database Design 3 09-03-2007 06:10 AM
About cpp connectivity govindaraj123 Mathematical Puzzles 5 08-06-2007 03:11 AM
I am getting database connectivity error sumana_i Test Director 0 04-06-2007 04:24 AM


All times are GMT -4. The time now is 09:19 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2009 GeekInterview.com. All Rights Reserved