I have a datagrid with template columns and when I call the dgeditponto_ItemDataBound (the code is above) i receive the following message:
"
DataBinder.Eval: 'System.Char' does not contain a property with the name Movimento"
Does anyone have any ideia of what causes this? I don't understand why.
Thanks to you all
Code:
Private Sub dgeditponto_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles dgeditponto.ItemDataBound
Dim ds As New DataSet
If e.Item.ItemType = ListItemType.EditItem Then
Dim strSql As String = "Select tipo_movimento.Cod_Tipo_movimento as [Movimento], tipo_movimento.Tipo_movimento as [Entradas/SaÃdas] from Tipo_movimento Order By tipo_movimento.Tipo_Movimento"
Dim myCommand As New SqlClient.SqlDataAdapter(strSql, sqlConFuncionarios)
myCommand.Fill(ds)
Try
With DirectCast(e.Item.FindControl("dbES"), DropDownList) 'keyword introduces a type conversion operation
.DataTextField = "Movimento"
.DataValueField = "Entradas/SaÃdas"
.DataSource = ds
.DataBind()
.SelectedIndex = .Items.IndexOf(.Items.FindByText(Me.m_ESseleccionada))
End With
'Catch ex As SqlException
' Response.Write("Ocorreu um erro na Base de Dados.")
'Catch ex As Exception
'Response.Write("Ocorreu um erro inesperado.")
Finally
If SqlConFuncionarios.State = ConnectionState.Open Then
SqlConFuncionarios.Close()
End If
End Try
End If
End Sub
Elisa Resina