Click here to Skip to main content
15,888,802 members
Home / Discussions / Visual Basic
   

Visual Basic

 
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 
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 
VB.NET
Imports MySql.Data.MySqlClient
Public Class frmCreditSubjs
    Public conn As New MySqlConnection
    Public cmd As New MySqlCommand
    Public cmd1 As New MySqlCommand
    Public dadapter As New MySqlDataAdapter
    Public datardr As MySqlDataReader
    Public strSql As String
    Public datardr1 As MySqlDataReader
    Public strSql1 As String
    Public subjectcode1 As String
    Public units1 As String
    Public preReq1 As String
    Public semester1 As String
    Public year1 As String
    Public count As Integer
    Private Sub InsertLoad()
        conn.ConnectionString = "server=localhost;userid=root;password=;database=aes"

        Try
            conn.Open()
            strSql = "select subjectcode, units, prereq, semester, year from tbl_subjects"
            cmd = New MySqlCommand(strSql, conn)
            datardr = cmd.ExecuteReader()
            While datardr.Read()
                count += 1
                subjectcode1 = datardr("subjectcode")
                units1 = datardr("units")
                preReq1 = datardr("prereq")
                semester1 = datardr("semester")
                year1 = datardr("year")
                
                Try
                    strSql = "INSERT INTO tbl_studProspectus values ('', '" & textSNumber.Text & "','" & subjectcode1 & "', '" & units1 & "', '" & preReq1 & "', '" & semester1 & "', '" & year1 & "','')"
                    cmd = New MySqlCommand(strSql, conn)
                    datardr = cmd.ExecuteReader()
                Catch ex As MySqlException
                    MessageBox.Show(ex.Message)
                Finally
                    conn.Dispose()
                End Try
            End While
        Catch ex As MySqlException
            MessageBox.Show(ex.Message)
        Finally
            conn.Dispose()
        End Try

    End Sub
    Private Sub frmCreditSubjs_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    End Sub
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        InsertLoad()
    End Sub
End Class

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 
QuestionExcel VBA For Loop Weighted Average Pin
Member 1226553729-Feb-16 22:40
Member 1226553729-Feb-16 22:40 
AnswerRe: Excel VBA For Loop Weighted Average Pin
Kenneth Haugland29-Feb-16 23:50
mvaKenneth Haugland29-Feb-16 23:50 
GeneralRe: Excel VBA For Loop Weighted Average Pin
Member 122655371-Mar-16 0:27
Member 122655371-Mar-16 0:27 
GeneralRe: Excel VBA For Loop Weighted Average Pin
Kenneth Haugland1-Mar-16 11:13
mvaKenneth Haugland1-Mar-16 11:13 
QuestionNet.Sockets.TcpListener Pin
hansoctantan29-Feb-16 1:40
professionalhansoctantan29-Feb-16 1:40 
QuestionRe: Net.Sockets.TcpListener Pin
Eddy Vluggen29-Feb-16 2:41
professionalEddy Vluggen29-Feb-16 2:41 

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.