Click here to Skip to main content
16,003,417 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionA VB Service Pin
Stephen Lintott22-Jul-08 23:24
Stephen Lintott22-Jul-08 23:24 
AnswerRe: A VB Service Pin
Dalek Dave23-Jul-08 0:32
professionalDalek Dave23-Jul-08 0:32 
GeneralRe: A VB Service Pin
Stephen Lintott23-Jul-08 1:11
Stephen Lintott23-Jul-08 1:11 
GeneralRe: A VB Service Pin
Dalek Dave23-Jul-08 1:39
professionalDalek Dave23-Jul-08 1:39 
GeneralRe: A VB Service Pin
Stephen Lintott23-Jul-08 1:44
Stephen Lintott23-Jul-08 1:44 
GeneralRe: A VB Service Pin
zahedonline23-Jul-08 1:49
zahedonline23-Jul-08 1:49 
GeneralRe: A VB Service Pin
Stephen Lintott23-Jul-08 1:55
Stephen Lintott23-Jul-08 1:55 
QuestionHow do I populate a Strongly Typed DataSet with XML Pin
penguin500022-Jul-08 23:03
penguin500022-Jul-08 23:03 
AnswerRe: How do I populate a Strongly Typed DataSet with XML Pin
Mycroft Holmes23-Jul-08 14:02
professionalMycroft Holmes23-Jul-08 14:02 
QuestionDATETIMEPICKER IN VB.NET Pin
r_mohd22-Jul-08 22:57
r_mohd22-Jul-08 22:57 
AnswerRe: DATETIMEPICKER IN VB.NET Pin
ilprincipe23-Jul-08 1:19
ilprincipe23-Jul-08 1:19 
GeneralRe: DATETIMEPICKER IN VB.NET Pin
zahedonline23-Jul-08 1:54
zahedonline23-Jul-08 1:54 
AnswerRe: DATETIMEPICKER IN VB.NET Pin
brjames3223-Jul-08 1:33
brjames3223-Jul-08 1:33 
QuestionHow to detect if a removable storage device is write protected?? Please help... Pin
vbDigger'z22-Jul-08 21:44
vbDigger'z22-Jul-08 21:44 
AnswerRe: How to detect if a removable storage device is write protected?? Please help... Pin
Paul Conrad27-Jul-08 11:03
professionalPaul Conrad27-Jul-08 11:03 
QuestionSaving DataGidView data to Excel Pin
brjames3222-Jul-08 21:25
brjames3222-Jul-08 21:25 
I have a project where a Teacher can choose their class from a ComboBox and this is turn selects all the relevant student from an Access Database and displays this along with some extra columns in a DataGridView.

The Teacher can then add 'Penalty Points' and 'Demerits' to the student before saving them to a spreadsheet (reason being the info needs a lot of formulas to get it to work out several thing the Heads of Year want to see!). I can Insert into Excel using code such as:

Imports System.Data
Public Class Form1
    Private Sub cmdSave_Click(ByVal sender As System.Object, _
                ByVal e As System.EventArgs) Handles cmdSave.Click
        Try
            Dim MyConnection As System.Data.OleDb.OleDbConnection
            Dim myCommand As New System.Data.OleDb.OleDbCommand
            Dim sql As String

            MyConnection = New System.Data.OleDb.OleDbConnection _
            ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + _
            "'S:\Penalty Points\07-08\Test.xls;Extended Properties=""Excel 8.0;HDR=Yes;IMEX=0""")

            MyConnection.Open()
            myCommand.Connection = MyConnection
            sql = "Insert into [Sheet1$] (StudentId,Name) values('5','e')"
            myCommand.CommandText = sql
            myCommand.ExecuteNonQuery()
            MyConnection.Close()
        Catch ex As Exception
            MsgBox(ex.ToString)
        End Try
        MsgBox("Row Added Successfully")
    End Sub
End Class


But I need to loop through the DatagridView, Inserting all rows that have been ammended. Can anyone help me out please?

Thanks in Advance Wink | ;)
AnswerRe: Saving DataGidView data to Excel Pin
brjames3223-Jul-08 6:27
brjames3223-Jul-08 6:27 
Questionhow to get combobox selected value in integer Pin
Kissy1622-Jul-08 21:24
Kissy1622-Jul-08 21:24 
AnswerRe: how to get combobox selected value in integer Pin
brjames3222-Jul-08 21:31
brjames3222-Jul-08 21:31 
GeneralRe: how to get combobox selected value in integer Pin
Kissy1622-Jul-08 22:00
Kissy1622-Jul-08 22:00 
GeneralRe: how to get combobox selected value in integer Pin
brjames3222-Jul-08 22:16
brjames3222-Jul-08 22:16 
GeneralRe: how to get combobox selected value in integer Pin
Kissy1622-Jul-08 22:43
Kissy1622-Jul-08 22:43 
AnswerRe: how to get combobox selected value in integer Pin
Tom Deketelaere23-Jul-08 1:15
professionalTom Deketelaere23-Jul-08 1:15 
GeneralRe: how to get combobox selected value in integer Pin
zahedonline23-Jul-08 1:58
zahedonline23-Jul-08 1:58 
QuestionMDI form in vb.net 2.0 Pin
vijaylumar22-Jul-08 19:19
vijaylumar22-Jul-08 19:19 

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.