I don't get the correct result
Posted: Sat 09 Dec 2006 12:37
Hey
Since today, I do have the professional Version with the latest build.
In VB 2005 I do use the following code:
The Problem is, that the DataReader only contains one Filed!
When I try the command in the MySQL Control Center it works correctly.
What can I do?
Yours faithfully[/code]
Since today, I do have the professional Version with the latest build.
In VB 2005 I do use the following code:
Code: Select all
Dim myDataReader As CoreLab.MySql.MySqlDataReader
'Die Daten in die Info Boxen einarbeiten
mySQLConnection.Open()
'Alle Aufträge zeigen
'HANDELSWARE
Dim HWOff As Integer = 0
Dim HWFak As Integer = 0
'Brille
Dim BrilleOff As Integer = 0
Dim BrilleFak As Integer = 0
'Kontaktlinse
Dim CLOff As Integer = 0
Dim CLFak As Integer = 0
mySQLCommand.CommandText = "Select @HWOffen:=Count(KundenID) From " & _
"AuftragHandelsware where KundenID=" & CDbl(lblKundenNummer.Text) & _
" and Bewegung=0;" & _
"Select @HWFakturiert:=Count(KundenID) From " & _
"AuftragHandelsware where KundenID=" & CDbl(lblKundenNummer.Text) & _
" and Bewegung=1;" & _
"Select @BROffen:=Count(KundenID) From " & _
"AuftragBrille Where KundenID=" & CDbl(lblKundenNummer.Text) & _
" and Bewegung=0 and left(BrillenArt, 2) 'CL';" & _
"Select @BRFakturiert:=Count(KundenID) From " & _
"AuftragBrille Where KundenID=" & CDbl(lblKundenNummer.Text) & _
" and Bewegung=1 and left(BrillenArt, 2) 'CL';" & _
"Select @CLOffen:=Count(KundenID) From " & _
"AuftragBrille Where KundenID=" & CDbl(lblKundenNummer.Text) & _
" and Bewegung=0 and left(BrillenArt, 2)='CL';" & _
"Select @CLFakturiert:=Count(KundenID) From " & _
"AuftragBrille Where KundenID=" & CDbl(lblKundenNummer.Text) & _
" and Bewegung=1 and left(BrillenArt, 2)='CL';" & _
"Select @HWOffen as HWOffen, @HWFakturiert as HWFakturiert, " & _
"@BROffen as BROffen, @BRFakturiert as BRFakturiert, " & _
"@CLOffen as CLOffen, @CLFakturiert as CLFakturiert;"
mySQLCommand.Connection = mySQLConnection
myDataReader = mySQLCommand.ExecuteReader
If myDataReader.Read = True Then
HWOff = myDataReader.Item(0)
HWFak = myDataReader.Item(1)
BrilleOff = myDataReader.Item(2)
BrilleFak = myDataReader.Item(3)
CLOff = myDataReader.Item(4)
CLFak = myDataReader.Item(5)
End If
myDataReader.Close()
mySQLConnection.Close()
When I try the command in the MySQL Control Center it works correctly.
What can I do?
Yours faithfully[/code]