C Board  

Go Back   C Board > General Programming Boards > C# Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 04-02-2004, 01:21 AM   #1
flashing vampire
 
black's Avatar
 
Join Date: May 2002
Posts: 563
ADO.Net step by step

howdy~

i used to code with ASP and now want to touch something on ASP.Net, fist i wonder how can i make connections with ADO.Net, i checked some tutos and find there must be 3 or 4 steps for achieve this. for i know first is to import System.Data.SqlClient class and build an instance of it, but get confused next steps ? anyone can share example code here plz ?
__________________
Never end on learning~
black is offline   Reply With Quote
Old 04-02-2004, 01:54 AM   #2
the hat of redundancy hat
 
nvoigt's Avatar
 
Join Date: Aug 2001
Location: Hannover, Germany
Posts: 2,768
PHP Code:
SqlConnection connection;

            try
            {
                
connection = new SqlConnection();
                
connection.ConnectionString "yourconnectstring:databasevendordependent";
                
connection.Open();
            }
            catch( 
SqlException exception )
            {
                
// error occurred, handle it here
            

The database connection string depends on the database server you have. I think the SqlConnection was meant to connect to an MS Sql Server. There are interfaces called IDbConnection and IDbCommand. Each database system can provide so-called data-providers for .NET to connect to their database system. Those implement the interfaces. For SQL Server its System.Data.SqlClient, for Oracle it's called ODP.NET and can be downloaded from Oracle or you can use the Microsoft drivers for Oracle. I don't know how they are called and I think you should use the drivers from the database vendor anyway.
__________________
hth
-nv

She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

When in doubt, read the FAQ.
Then ask a smart question.
nvoigt is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
debugging - step into issue barneygumble742 C++ Programming 7 03-15-2009 12:30 PM
recursion paulmedic555 C Programming 26 01-28-2005 12:43 AM
robot step sizes n00by C Programming 2 04-29-2004 03:29 PM
step by step debug != run debug bonkey Windows Programming 8 09-09-2002 12:55 PM
this sites Compiler Resources Specs. Powerfull Army C++ Programming 9 07-08-2002 06:12 PM


All times are GMT -6. The time now is 10:34 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22