Getting the data from the database

  • Thread starter Thread starter simon
  • Start date Start date
S

simon

I have for example sql="SELECT articleText FROM articles where articleID=1"

I used to get the text very simple, like this:
articleText=connection.execute(SQL).Fields.Item(0).Value

How can I do the same in asp.net?

Or if I need also the name of article: sql="SELECT articleText,articleName
FROM articles where articleID=1"
I cant find any simple method.
Do I have to create an dataSet and write for example:
dataset.tables(0).rows(0).item(0)
or is there any easier way to get the text from the database?

Thank you,
SImon
 
Read the msdn for SqlCommand - you don't have to use DataSet - you can use
SqlCommand with its different methods

Ronen
 
Back
Top