Need some help with asp.net and fill labels from a database.

M

Morten

Hi.

I have just began to use vb.net/ asp.net.
Now I am trying to undertand ado.net and use of it.

The datagrid it seems I got right but how do I "fill" e.g. a label.
Previous I dis label.caption= rs!something.

Now I have
Dim custNmAdapter As New OleDb.OleDbDataAdapter("SELECT Nm from myTable
where id=1")
Dim dsCustNm As DataSet = New DataSet()
custNmAdapter.Fill(dsCustNm, "Intelle_CustNm")
So if anyone please could show me how I can get data into my label I would
be fextreamly happy.
label.text=???

Thanks
Morten
 
A

Anuradha

Hi,

You just have to access with the the rows in the dataset.
Have a look at the Dataset class
dsCustNm.Tables["Intelle_CustNm"].Rows[0].Columns
["columnName"]
 
M

Morten

Thanks.

U got me on track again.

:) Morten

Anuradha said:
Hi,

You just have to access with the the rows in the dataset.
Have a look at the Dataset class
dsCustNm.Tables["Intelle_CustNm"].Rows[0].Columns
["columnName"]

-----Original Message-----
Hi.

I have just began to use vb.net/ asp.net.
Now I am trying to undertand ado.net and use of it.

The datagrid it seems I got right but how do I "fill" e.g. a label.
Previous I dis label.caption= rs!something.

Now I have
Dim custNmAdapter As New OleDb.OleDbDataAdapter("SELECT Nm from myTable
where id=1")
Dim dsCustNm As DataSet = New DataSet()
custNmAdapter.Fill(dsCustNm, "Intelle_CustNm")
So if anyone please could show me how I can get data into my label I would
be fextreamly happy.
label.text=???

Thanks
Morten


.
 

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

Top