Imports System.Data.OleDb Imports System.IO Public Class Designs Dim conn As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Application.StartupPath & "\DATABASE.accdb") Dim dr As OleDbDataReader Dim flag As Boolean Dim dt As DataTable Dim da As OleDbDataAdapter Dim a As Integer Dim count As Integer Private Sub txt_strips_TextChanged(sender As Object, e As EventArgs) End Sub Sub count1() conn.Open() Dim cmd As New OleDb.OleDbCommand("select count (*) from Catelog", conn) count = cmd.ExecuteScalar conn.Close() End Sub Private Sub chc_flower_CheckedChanged(sender As Object, e As EventArgs) Handles chc_flower.CheckedChanged End Sub Private Sub chc_logo_CheckedChanged(sender As Object, e As EventArgs) Handles chc_logo.CheckedChanged End Sub Sub GETMYID() Try conn.Open() Dim cmd As New OleDbCommand("Select * from Catelog", conn) da = New OleDbDataAdapter dt = New DataTable da.SelectCommand = cmd da.Fill(dt) Guna2TextBox1.Text = dt.Rows(a).Item("ID") txt_design.Text = txt_design.PlaceholderText & ": " & dt.Rows(a).Item("Design") _Sales.lbl_design.Text = dt.Rows(a).Item("Design") check_head.Checked = dt.Rows(a).Item("Headstone") txt_head.Text = txt_head.PlaceholderText & ": " & dt.Rows(a).Item("Headstone_size") chc_ledger.Checked = dt.Rows(a).Item("Ledger") txt_ledger.Text = txt_ledger.PlaceholderText & ": " & dt.Rows(a).Item("Ledger_size") chc_strips.Checked = dt.Rows(a).Item("Strips") txt_strips.Text = txt_strips.PlaceholderText & ": " & dt.Rows(a).Item("Strips_size") chc_vases.Checked = dt.Rows(a).Item("Vases") chc_pavers.Checked = dt.Rows(a).Item("Pavers") chc_flower.Checked = dt.Rows(a).Item("Flower_boarderline") chc_logo.Checked = dt.Rows(a).Item("Logo_emblem") chc_pic.Checked = dt.Rows(a).Item("Picture") cmb_picsize.Text = dt.Rows(a).Item("Picture_size") txt_price.Text = txt_price.PlaceholderText & ": USD $" & dt.Rows(a).Item("Price") _Sales.lbl_price.Text = dt.Rows(a).Item("Price") txt_colour.Text = txt_colour.PlaceholderText & ": " & dt.Rows(a).Item("Colour") Dim picture As Byte designpic.Image = Nothing picture = dt.Rows(a).Item("Picture_design") Dim mstream As New System.IO.MemoryStream(picture) designpic.Image = Image.FromStream(mstream) Catch ex As Exception End Try conn.Close() End Sub Private Sub cmb_picsize_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cmb_picsize.SelectedIndexChanged End Sub Private Sub Designs_Load(sender As Object, e As EventArgs) Handles MyBase.Load a = 0 count1() GETMYID() If a = 0 Then img_back.Visible = False Else img_back.Visible = True End If End Sub Private Sub Guna2CirclePictureBox1_Click(sender As Object, e As EventArgs) Handles img_back.Click a = a - 1 If a = 0 Then img_back.Visible = False Else img_back.Visible = True End If If a < count - 1 Then img_next.Visible = True Else img_next.Visible = False End If GETMYID() End Sub Private Sub img_next_Click(sender As Object, e As EventArgs) Handles img_next.Click a = a + 1 If a = count - 1 Then img_next.Visible = False Else img_next.Visible = True End If If a > 0 Then img_back.Visible = True Else img_back.Visible = False End If GETMYID() End Sub Private Sub btndesign_Click(sender As Object, e As EventArgs) Handles btndesign.Click With _Sales .txt_design.Text = txt_design.Text .txt_designprice.Text = txt_price.Text .lbl_id.Text = Guna2TextBox1.Text End With Me.Hide() End Sub Private Sub Guna2Panel1_Paint(sender As Object, e As PaintEventArgs) Handles Guna2Panel1.Paint End Sub End Class
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)