A
Amirallia
Hi everybody...
I use VS 2005 with WinCE 5.0
Here is my code :
Sub ChargerClasse()
Dim dtTable03 As New DataTable
Dim daTable03 As New SqlServerCe.SqlCeDataAdapter
Dim Cmd As New SqlServerCe.SqlCeCommand
Try
Me.cbxClasse.Items.Clear()
Cmd.CommandText = "SELECT Num_class, (Num_class & ' - ' &
Des_abr) as Designation FROM Table03 ORDER BY Des_abr"
daTable03.SelectCommand = Cmd
daTable03.SelectCommand.Connection = ConnDB
daTable03.Fill(dtTable03)
Me.cbxClasse.DataSource = dtTable03
Me.cbxClasse.DisplayMember = "Designation"
Me.cbxClasse.ValueMember = "Num_class"
Catch g As SqlServerCe.SqlCeException
MessageBox.Show(g.NativeError & "::" & g.Message)
Catch ex As Exception
MessageBox.Show(ex.Message & " : " & "ChargerClasse")
End Try
End Sub
Sql mobile doesn't accept the "as" statment in the sql ?
I must use this to set the Me.cbxClasse.DisplayMember with two fields.
Any idea to get the "Me.cbxClasse.DisplayMember" with two fields ?
Thanks
I use VS 2005 with WinCE 5.0
Here is my code :
Sub ChargerClasse()
Dim dtTable03 As New DataTable
Dim daTable03 As New SqlServerCe.SqlCeDataAdapter
Dim Cmd As New SqlServerCe.SqlCeCommand
Try
Me.cbxClasse.Items.Clear()
Cmd.CommandText = "SELECT Num_class, (Num_class & ' - ' &
Des_abr) as Designation FROM Table03 ORDER BY Des_abr"
daTable03.SelectCommand = Cmd
daTable03.SelectCommand.Connection = ConnDB
daTable03.Fill(dtTable03)
Me.cbxClasse.DataSource = dtTable03
Me.cbxClasse.DisplayMember = "Designation"
Me.cbxClasse.ValueMember = "Num_class"
Catch g As SqlServerCe.SqlCeException
MessageBox.Show(g.NativeError & "::" & g.Message)
Catch ex As Exception
MessageBox.Show(ex.Message & " : " & "ChargerClasse")
End Try
End Sub
Sql mobile doesn't accept the "as" statment in the sql ?
I must use this to set the Me.cbxClasse.DisplayMember with two fields.
Any idea to get the "Me.cbxClasse.DisplayMember" with two fields ?
Thanks