Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

how find recored from the database

Answer Posted / eric

You mean: "How do I get records from a database?"

You have to get the "dotnet driver" of the database (or any
other datasource) you want to access to.

For example:
MySQL: Connector/Net
Access: Microsoft Access Driver
Oracle: Oracle Data Access Components (ODAC)

Afterwards you build a connection string to tell your
programm which driver you want to use and where the
datasource can be found, for example:

public const string DB_CONN_STRING =
"Driver={Microsoft Access Driver (*.mdb)}; "+
"DBQ=D:\\CS\\TestDbReadWrite\\SimpleTest.mdb";

Afterwards you just have to open a connection to the
database using the previously created connection string and
send a query to the database to get the record:

ADOConnection conn = new ADOConnection(DB_CONN_STRING);
conn.Open();
ADODataReader dr;
ADOCommand cmd = new ADOCommand( "SELECT * FROM <table>",
conn );
cmd.Execute(out dr);
while (dr.Read()){
....}

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I change the console application in windows?

942


How many navigational features are provided by visual studio.net ide?

994


Name the template that is used to create a user-defined component.

875


Suppose I am implementing one windows form. I am inserting some values into ms access. In that table 5 columns there. But I want to insert three columns only. When I am clicking another button then other two values also insert into that table?

934


What are the forms of database?

928


How to show a ContextMenuStrip instead of cthe default ContextMenuStrip,when you rightclick on the non client area of a window's Form or when alt+space keys are pressed

2187


Explain the difference between listindex and tab index?

984


which property is used to change to some value to access a identity column in datacontrols?

2048


How will calculated the net amount in tax add like total net amount = LT+ST+CESS+amount 2500 = 10%+12.5%+5.15%+amount? kindly please explain what type of formula we apply in software? Tushar

2421


Which event occurs when a user drags an item in a treeview or listview control?

920


Which dialog box allows users to switch to another area of the application?

992


Is typeform free?

887


What is window form application?

885


What is difference between winforms and windows forms?

1026


What are the advantages of form?

906