Newb database question

therock

New member
Joined
Jun 18, 2003
Messages
4
Location
Rotterdam
Hello, I have been working with ASP.NET pages using access. Now I have my sql server 2000 up and running. Can someone give me a quick newb rundown of how to access data from sql server 2000? Can you go over the connection string in detail and give me some code to start off with to access one of the premade databases such as pubs. Thanks in advance. also give me some tips of some of the troubles you had when you were a newb to sql 2000.

P.S. Sorry if there was a thread like this one, I could not find it.
 
hie,
the connection code s simple basically...
what u have in access is almost the same as in SQL

dim conPubs as SqlConnection
dim cmdSelectLogin as SqlCommand
dim login as SqlDataReader

conPubs=New SqlConnection("Server=localhost;User Id=sa;Password=edna;database=TA")
conPubs.Open()
cmdSelectLogin= new SqlCommand ("Select Name From Passwd", conPubs)
login =cmdSelectLogin.ExecuteReader()

for a basic connection u need 3 things - sqlconnection, sqlcommand and a sqldata reader..
the sqlconnection is used to set the database name, passwd and others..
while the sql command is to store all your sql commands/query
and the data reader is basically to store all the results from the query

:p
 
Back
Top