Click here to Skip to main content
16,020,305 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
VB
Imports System.Data.OleDb

Public Class VEGTOPPINGS
    Dim connString As String = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=C:\CHE10\SEM 6\MYPROJECT\PIZZAHUT PROJECTS\PIZZAHUT PROJECTS\PIZZAHUT.accdb"
    Dim MyConn As OleDbConnection
    Dim da As OleDbDataAdapter
    Dim ds As DataSet
    Dim tables As DataTableCollection
    Dim source1 As New BindingSource
    Private Sub btnback_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnback.Click
        Dim obj As New ITEMS
        Me.Hide()
        obj.Show()

    End Sub

    Private Sub btnnext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnnext.Click
        ' Dim obj1 As New NONVEGTOPPINGS
        Me.Hide()
        NONVEGTOPPINGS.Show()
    End Sub

    Private Sub btndone_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btndone.Click
        Dim obj2 As New CUSTOMERDETAILS
        Me.Hide()
        obj2.Show()
    End Sub

    Private Sub VEGTOPPINGS_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'PIZZAHUTDataSet3.VEGTOPPINGS' table. You can move, or remove it, as needed.
        Me.VEGTOPPINGSTableAdapter.Fill(Me.PIZZAHUTDataSet3.VEGTOPPINGS)
        Me.BindGrid()

    End Sub
    Private Sub BindGrid()
        Using con As New OleDbConnection(connString)
            Using cmd As New OleDbCommand("SELECT * FROM VEGTOPPINGS", con)
                cmd.CommandType = CommandType.Text
                Using sda As New OleDbDataAdapter(cmd)
                    Using dt As New DataTable()
                        sda.Fill(dt)
                        '  DataGridView1.DataSource = dt
                    End Using
                End Using
            End Using
        End Using
        'Dim checkBoxColumn As New DataGridViewCheckBoxColumn()
        'checkBoxColumn.HeaderText = ""
        'checkBoxColumn.Width = 30
        'checkBoxColumn.Name = "checkBoxColumn"
        ''DataGridView1.Columns.Insert(0, checkBoxColumn)

    End Sub

    Private Sub VEGTOPPINGSDataGridView_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles VEGTOPPINGSDataGridView.CellContentClick

        top_id = VEGTOPPINGSDataGridView.Rows(e.RowIndex).Cells(1).Value
        Dim c As Integer = 0

        For Each row As DataGridViewRow In Me.VEGTOPPINGSDataGridView.Rows
            If row.Index <> Me.VEGTOPPINGSDataGridView.Rows(e.RowIndex).Cells(1).CheckState Then
                If (row.Cells(1).Value) Then
                    row.Selected = True

                    c = c + 1

                End If


            End If
        Next
        MsgBox(c)

    End Sub
End Class
Posted
Updated 24-Jan-16 6:18am
v2
Comments
Sergey Alexandrovich Kryukov 24-Jan-16 14:12pm    
What's the problem?
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900