English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

how to show dataset records values in cell of a table

2006-07-02 18:20:52 · 3 answers · asked by sudeshna_cal2004 1 in Computers & Internet Programming & Design

3 answers

VB.NET & ASP.NET Code fragment......
Hope it wil help you to understand

The code creates table row

Dim objConn As New SqlConnection(Session("conString"))
Dim dr As SqlDataReader
Dim cmd As New SqlCommand
Dim Row As New TableRow
Try
objConn.Open()
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = "sp_GetRecord"
cmd.Connection = objConn
dr = cmd.ExecuteReader

While dr.Read
Dim Cell As New TableCell
Cell.Text = dr.Item(0)
Row.Cells.Add(Cell)
End While
' tblMenu is a name of table
tblMenu.Rows.Add(Row)
Catch ex As Exception
Response.Write(ex.Message)
Finally
If dr.IsClosed = False Then
dr.Close()
End If
End Try

2006-07-02 18:28:17 · answer #1 · answered by dhin_tak_dhin 2 · 0 0

Since you didn't specify the type of system or software, take a look at the link below, it may help you to figure it out for yourself.

2006-07-02 18:25:08 · answer #2 · answered by Rev Debi Brady 5 · 0 0

C'mon. please.

What tool is the database in?

What are you going to show the data in (Excel, Word, HTML?)

Delete this question and start over.

2006-07-02 18:22:56 · answer #3 · answered by RDHamm 4 · 0 0

fedest.com, questions and answers