Click here to Skip to main content
15,896,118 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Error in IE11 for website automation using vb6 Pin
Mycroft Holmes4-Apr-16 14:20
professionalMycroft Holmes4-Apr-16 14:20 
AnswerRe: Error in IE11 for website automation using vb6 Pin
CHill604-Apr-16 22:40
mveCHill604-Apr-16 22:40 
QuestionCalculate networkdays in vb.net, can someone help me? Pin
Real Corks27-Mar-16 11:57
Real Corks27-Mar-16 11:57 
GeneralRe: Calculate networkdays in vb.net, can someone help me? Pin
Sascha Lefèvre27-Mar-16 12:29
professionalSascha Lefèvre27-Mar-16 12:29 
AnswerRe: Calculate networkdays in vb.net, can someone help me? Pin
CHill6027-Mar-16 12:44
mveCHill6027-Mar-16 12:44 
Questionsum a field in database, can someone help me? Pin
Real Corks27-Mar-16 4:21
Real Corks27-Mar-16 4:21 
AnswerRe: sum a field in database, can someone help me? Pin
Sascha Lefèvre27-Mar-16 4:58
professionalSascha Lefèvre27-Mar-16 4:58 
GeneralRe: sum a field in database, can someone help me? Pin
Real Corks27-Mar-16 9:05
Real Corks27-Mar-16 9:05 
C#
Dim startDate As DateTime
        Dim endDate As DateTime
       
        If Not DateTime.TryParse(dtpstart.Text, startDate) Then
            ' error indication and return
        End If

        If Not DateTime.TryParse(dtpend.Text, endDate) Then
            ' error indication and return
        End If

        
        Dim sql As String = "SELECT dates BETWEEN @startDate and @endDate, SUM( late ) AS SumTotalLate FROM tbl_attendance WHERE employeeNumber =  @empno"

        Try
            Using conn1 As New MySqlConnection("server=localhost;userid=root;password=;database=amwps") ' ConnectionString from somewhere central
                Using cmd As New MySqlCommand(sql, conn)

                    cmd.Parameters.AddWithValue("@empNo", TextEmpNo)
                    cmd.Parameters.AddWithValue("@startDate", startDate)
                    cmd.Parameters.AddWithValue("@endDate", endDate)

                    conn.Open()

                    Dim val As Integer = cmd.ExecuteScalar("SumTotalLate")
                    TextLateDeduct.Text = val.ToString()

                End Using
            End Using
        Catch ex As MySqlException
            MessageBox.Show(ex.Message)
        End Try

sumtotallate can't display in textbox, it having an error "
C#
No default member found for type 'DBNull'.

but when i've try it to my mysql localhost it gives accurate result. 2.40
GeneralRe: sum a field in database, can someone help me? Pin
Sascha Lefèvre27-Mar-16 9:42
professionalSascha Lefèvre27-Mar-16 9:42 
GeneralRe: sum a field in database, can someone help me? Pin
Real Corks27-Mar-16 9:47
Real Corks27-Mar-16 9:47 
GeneralRe: sum a field in database, can someone help me? Pin
Sascha Lefèvre27-Mar-16 10:12
professionalSascha Lefèvre27-Mar-16 10:12 
GeneralRe: sum a field in database, can someone help me? Pin
Real Corks27-Mar-16 11:29
Real Corks27-Mar-16 11:29 
Questioncan someone help me to fix this? because i cannot make another xml file only the employee information Pin
Real Corks17-Mar-16 17:47
Real Corks17-Mar-16 17:47 
AnswerRe: can someone help me to fix this? because i cannot make another xml file only the employee information Pin
Patrice T17-Mar-16 20:49
mvePatrice T17-Mar-16 20:49 
GeneralRe: can someone help me to fix this? because i cannot make another xml file only the employee information Pin
Real Corks20-Mar-16 21:43
Real Corks20-Mar-16 21:43 
GeneralRe: can someone help me to fix this? because i cannot make another xml file only the employee information Pin
CHill6020-Mar-16 22:41
mveCHill6020-Mar-16 22:41 
GeneralRe: can someone help me to fix this? because i cannot make another xml file only the employee information Pin
Real Corks27-Mar-16 4:18
Real Corks27-Mar-16 4:18 
GeneralRe: can someone help me to fix this? because i cannot make another xml file only the employee information Pin
CHill6027-Mar-16 5:29
mveCHill6027-Mar-16 5:29 
GeneralRe: can someone help me to fix this? because i cannot make another xml file only the employee information Pin
Richard MacCutchan21-Mar-16 1:10
mveRichard MacCutchan21-Mar-16 1:10 
GeneralRe: can someone help me to fix this? because i cannot make another xml file only the employee information Pin
Dave Kreskowiak21-Mar-16 2:47
mveDave Kreskowiak21-Mar-16 2:47 
GeneralRe: can someone help me to fix this? because i cannot make another xml file only the employee information Pin
Richard MacCutchan21-Mar-16 2:55
mveRichard MacCutchan21-Mar-16 2:55 
Questionvb.net 2010 has sql error Pin
dcof16-Mar-16 12:28
dcof16-Mar-16 12:28 
AnswerRe: vb.net 2010 has sql error Pin
Mycroft Holmes16-Mar-16 23:08
professionalMycroft Holmes16-Mar-16 23:08 
AnswerRe: vb.net 2010 has sql error Pin
dcof17-Mar-16 8:43
dcof17-Mar-16 8:43 
Questionvb Pin
Member 1239502015-Mar-16 18:23
Member 1239502015-Mar-16 18:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.