Click here to Skip to main content
15,889,859 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Insert data in multiple table and having froreign key... Pin
Mycroft Holmes13-Mar-16 21:25
professionalMycroft Holmes13-Mar-16 21:25 
QuestionExperiencing odd behavior when adding new row to datagridview (databound to bs) Pin
Jon_Boy4-Mar-16 3:45
Jon_Boy4-Mar-16 3:45 
AnswerRe: Experiencing odd behavior when adding new row to datagridview (databound to bs) Pin
Eddy Vluggen4-Mar-16 12:04
professionalEddy Vluggen4-Mar-16 12:04 
GeneralRe: Experiencing odd behavior when adding new row to datagridview (databound to bs) Pin
Jon_Boy4-Mar-16 14:39
Jon_Boy4-Mar-16 14:39 
GeneralRe: Experiencing odd behavior when adding new row to datagridview (databound to bs) Pin
Eddy Vluggen4-Mar-16 23:37
professionalEddy Vluggen4-Mar-16 23:37 
GeneralRe: Experiencing odd behavior when adding new row to datagridview (databound to bs) Pin
Jon_Boy9-Mar-16 10:45
Jon_Boy9-Mar-16 10:45 
GeneralRe: Experiencing odd behavior when adding new row to datagridview (databound to bs) Pin
Eddy Vluggen9-Mar-16 10:58
professionalEddy Vluggen9-Mar-16 10:58 
QuestionCan someone help me "How to compute late and total hours and save to another column same datagrid view with this code"? Pin
Real Corks2-Mar-16 12:13
Real Corks2-Mar-16 12:13 
C#
conn.ConnectionString = "server=localhost;userid=root;password=;database=amwps"
        Dim result As Integer
        Dim dto As DateTime
        Dim dfrom As datetime
        Try
            conn.Open()
            For Each row As DataGridViewRow In DataGridView1.Rows
                If row.Cells(0).FormattedValue <> "" Or row.Cells(1).FormattedValue <> "" Then
                    Dim sDateFrom As String
                    Dim sDateTo As Double
                    sDateFrom = CStr(row.Cells(3).FormattedValue)
                    sDateTo = CStr(row.Cells(4).FormattedValue)
                    tHrs = sDateFrom - sDateTo
                    strSql = "INSERT INTO tbl_attendance (id, employeeNumber, dates, timein, timeout, totalhrs, late) VALUES ('" _
                                & CStr(row.Cells(0).FormattedValue) & "','" _
                                & CStr(row.Cells(1).FormattedValue) & "','" _
                                & CStr(row.Cells(2).FormattedValue) & "','" _
                                & CStr(row.Cells(3).FormattedValue) & "','" _
                                & CStr(row.Cells(4).FormattedValue) & "','" _
                                & CStr(row.Cells(5).FormattedValue) & "','" _
                                & CStr(row.Cells(6).FormattedValue) & "')"
                    With cmd
                        .Connection = conn
                        .CommandText = strSql
                    End With
                    result = cmd.ExecuteNonQuery
                End If

            Next
            If result = 0 Then
                MsgBox("No saved Record.")
            Else
                MsgBox("All Records Saved.")
            End If
        Catch ex As MySqlException
            MessageBox.Show(ex.Message)
        Finally
            conn.Dispose()
        End Try
        conn.Close()

AnswerRe: Can someone help me "How to compute late and total hours and save to another column same datagrid view with this code"? Pin
Richard MacCutchan2-Mar-16 21:12
mveRichard MacCutchan2-Mar-16 21:12 
AnswerRe: Can someone help me "How to compute late and total hours and save to another column same datagrid view with this code"? Pin
Richard Deeming2-Mar-16 22:34
mveRichard Deeming2-Mar-16 22:34 
GeneralRe: Can someone help me "How to compute late and total hours and save to another column same datagrid view with this code"? Pin
Richard MacCutchan2-Mar-16 22:49
mveRichard MacCutchan2-Mar-16 22:49 
GeneralRe: Can someone help me "How to compute late and total hours and save to another column same datagrid view with this code"? Pin
Real Corks3-Mar-16 19:25
Real Corks3-Mar-16 19:25 
GeneralRe: Can someone help me "How to compute late and total hours and save to another column same datagrid view with this code"? Pin
Richard MacCutchan3-Mar-16 21:40
mveRichard MacCutchan3-Mar-16 21:40 
Questioncan someone help me to fix this in mysql vb "INVALID ATTEMP TO READ WHEN READER IS CLOSE "? Pin
Real Corks2-Mar-16 6:40
Real Corks2-Mar-16 6:40 
AnswerRe: can someone help me to fix this in mysql vb "INVALID ATTEMP TO READ WHEN READER IS CLOSE "? Pin
Dave Kreskowiak2-Mar-16 6:51
mveDave Kreskowiak2-Mar-16 6:51 
GeneralRe: can someone help me to fix this in mysql vb "INVALID ATTEMP TO READ WHEN READER IS CLOSE "? Pin
Real Corks2-Mar-16 7:41
Real Corks2-Mar-16 7:41 
GeneralRe: can someone help me to fix this in mysql vb "INVALID ATTEMP TO READ WHEN READER IS CLOSE "? Pin
Real Corks2-Mar-16 7:49
Real Corks2-Mar-16 7:49 
GeneralRe: can someone help me to fix this in mysql vb "INVALID ATTEMP TO READ WHEN READER IS CLOSE "? Pin
Dave Kreskowiak2-Mar-16 7:58
mveDave Kreskowiak2-Mar-16 7:58 
GeneralRe: can someone help me to fix this in mysql vb "INVALID ATTEMP TO READ WHEN READER IS CLOSE "? Pin
Real Corks2-Mar-16 8:15
Real Corks2-Mar-16 8:15 
GeneralRe: can someone help me to fix this in mysql vb "INVALID ATTEMP TO READ WHEN READER IS CLOSE "? Pin
Sascha Lefèvre2-Mar-16 8:46
professionalSascha Lefèvre2-Mar-16 8:46 
GeneralRe: can someone help me to fix this in mysql vb "INVALID ATTEMP TO READ WHEN READER IS CLOSE "? Pin
Real Corks2-Mar-16 11:40
Real Corks2-Mar-16 11:40 
AnswerRe: can someone help me to fix this in mysql vb "INVALID ATTEMP TO READ WHEN READER IS CLOSE "? Pin
Richard Deeming2-Mar-16 9:49
mveRichard Deeming2-Mar-16 9:49 
GeneralRe: can someone help me to fix this in mysql vb "INVALID ATTEMP TO READ WHEN READER IS CLOSE "? Pin
Real Corks2-Mar-16 11:46
Real Corks2-Mar-16 11:46 
GeneralRe: can someone help me to fix this in mysql vb "INVALID ATTEMP TO READ WHEN READER IS CLOSE "? Pin
Real Corks2-Mar-16 11:52
Real Corks2-Mar-16 11:52 
GeneralRe: can someone help me to fix this in mysql vb "INVALID ATTEMP TO READ WHEN READER IS CLOSE "? Pin
Real Corks2-Mar-16 12:45
Real Corks2-Mar-16 12:45 

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.