Getting the data from the database

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
 
R

RA

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

Ronen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top