W
Will Chamberlain
I'm trying to populate a label that is located in the Footer Template of
my DataGrid. I want this to be displayed in a label instead of a
textbox when the user wants to add a new record because I don't want
them to have mess with this field.
-----
Dim ds as new dataset
Dim objCommand as new oledbCommand(strSQL, objConn)
Dim myCommand as new OleDbDataAdapter(strSQL, objConn)
myCommand.Fill(ds, "DataTable")
lblID.text = ds.Tables("DataTable").Rows(0)("ID")
-----
When I run the page nothing is displayed in the footer for this field.
I figured this way would work simply because the datagrid's datasource
is the same dataset. Since the dataset is already filled I should just
be able to grab the ID from the dataset right? Any suggestions?
my DataGrid. I want this to be displayed in a label instead of a
textbox when the user wants to add a new record because I don't want
them to have mess with this field.
-----
Dim ds as new dataset
Dim objCommand as new oledbCommand(strSQL, objConn)
Dim myCommand as new OleDbDataAdapter(strSQL, objConn)
myCommand.Fill(ds, "DataTable")
lblID.text = ds.Tables("DataTable").Rows(0)("ID")
-----
When I run the page nothing is displayed in the footer for this field.
I figured this way would work simply because the datagrid's datasource
is the same dataset. Since the dataset is already filled I should just
be able to grab the ID from the dataset right? Any suggestions?