Hello All!!
Can’t figure out for the life of me how to get the value from a DataColumn and throw it in a label. I’ve tried about every variation I can think of, and no dice. I know the DataSet/DataTable was populated correctly, and I know the name of the column I want is “JDESC”
Here’s the code:
lblJobName.Text = ds.Tables(“MASTER_JCM_R1”).Rows[0].(Item(“JDESC”).Value)
I’ve also tried:
ds.Tables(“MASTER_JCM_R1”).Columns(“JDESC”).Value
ds.Tables(“MASTER_JCM_R1”).Columns(“JDESC”).ToString()
ds.Tables(“MASTER_JCM_R1”).Rows[0].Item(“JDESC”).ToString()
…a few others as well. ALL generate the error:
Value of type ‘System.Data.DataRowCollection’ cannot be converted to ‘String’
Help! Thanks so much!