开发者

ASP: Assign a Gridview Value to a label

开发者 https://www.devze.com 2023-03-02 13:46 出处:网络
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

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
0

精彩评论

暂无评论...
验证码 换一张
取 消