ASP: Assign a Gridview Value to a label
How can i assign a value in the Gridview to a label?
Dim Command3 As New SqlCommand
Adapter = New SqlDataAdapter("Select [Parking_Cost] FROM开发者_运维问答 Parking Where [Parking_ID] = @Parking_ID2", myConn)
Adapter.SelectCommand.Parameters.AddWithValue("@Parking_ID2", Parking_ID2)
Adapter.Fill(Dataset)
Total.DataSource = Dataset
Label14.DataBind()
Total.DataBind()
Tried binding did not work
Any ideas?
Regards.
You can do something like this. If there's only one Datatable
in your Dataset
then table index is 0.
label14.text = Datatset.Tables(table index).Rows.Item(row index)(column index).ToString
精彩评论