ชุมชนคนรักภาษาเบสิค - Visual Basic Community

 ลืมรหัสผ่าน
 ลงทะเบียน
ค้นหา
ดู: 29500|ตอบกลับ: 28

แจกฟรีโค้ดโปรแกรมการเก็บบันทึกข้อมูลบุคคล โดยใช้ VB.NET + MS Access 2007+

[คัดลอกลิงก์]

308

กระทู้

498

โพสต์

5971

เครดิต

ผู้ดูแลระบบ

ทองก้อน ทับทิมกรอบ

Rank: 9Rank: 9Rank: 9

เครดิต
5971


คำอธิบายโปรเจค (ฉบับย่อ) ...
โค้ดโปรแกรมนี้เป็นการ เก็บข้อมูลในลักษณะที่เรียกว่า One To One ซึ่งเป็นพื้นฐานของระบบงานฐานข้อมูล และเป็นการเขียนโค้ดในลักษณะแบบ @Run Time ทั้งหมด แน่นอนว่าจะไม่เหมาะกับบรรดามือใหม่หัดขับทั้งหลาย แต่ก็สามารถเก็บเอาไว้ดูได้ในวันหนึ่งข้างหน้า ... แอดมินจะแยกโค้ดออกเป็น 2 ส่วน คือแบบมีภาพ กับไม่มีภาพ ส่วนโค้ดที่ไม่มีภาพ ก็เพื่อให้เข้าใจกระบวนการขั้นตอนได้ง่ายขึ้น ซึ่งจะได้ไม่พะวงหรืองงสับสนเกินไป ส่วนโค้ดที่มีภาพ จะเป็นการจัดเก็บข้อมูลรูปภาพ โดยใช้เฉพาะชื่อไฟล์เท่านั้น ส่วน Path จะกำหนดแบบ Run Time จากตัวโปรแกรม ไม่ได้จัดเก็บแบบ BLOB (Binary Large OBject) เพราะจะทำให้ฐานข้อมูลมีขนาดใหญ่ เกินความจำเป็น

ทั้งนี้ทั้งนั้นโค้ดที่แอดมินกล้านำออกมาเผยแพร่ให้รับรู้กันอย่างฟรีๆนี้ แทบจะใกล้เคียงกับโค้ดจริงที่แอดมินใช้งานอยู่ แต่คอนเซปท์ หรือ ลักษณะขั้นตอนการดำเนินการ (Flow Control) น่ะใช่เลย (โค้ดชุดนี้แอดมินโพสต์ไปที่เว็บนอกแต่ไม่ได้ละเอียดเท่านี้ครับ) ...

สิ่งที่แอดมินต้องการ ...
- หากสมาชิกมีคำถามใดๆ ก็ขอเชิญโพสต์ถามลงมาในเว็บบอร์ดได้เลย ขอความกรุณาอย่าถามมาเป็นการส่วนตัวครับ
- หากสมาชิกมีไอเดียก็ดี หรือมีการปรับปรุงโค้ดให้ดีขึ้น ก็ช่วยโพสต์ลงมาแบ่งปันให้กับคนอื่นๆได้รับรู้บ้าง หรือหากเขินอายไม่กล้าแสดงตัว ก็ส่งมาให้แอดมินดำเนินการแทนก็ได้ครับ
- จะอะไรก็ตามแต่ แอดมินก็ต้องการอยากจะให้มีฟีดแบ็คกลับมาบ้าง เพื่อจะได้นำมาใช้ปรับปรุง รวมไปถึงการแจกโค้ดตัวอื่นๆในลำดับต่อไป (ตอนนี้ก็มีเตรียมไว้แล้ว)
- คิดไม่ออกล่ะ ... จบก่อน 5555+

หากท่านไม่ยอมเสียสละเวลาเล็กน้อยเพื่อสมัครสมาชิก ไม่ว่าจะด้วยเหตุผลอะไรก็ตามแต่ ก็ขอเชิญเอาโค้ดไปแปะทำเองได้เลยครับ

โค้ดฉบับเต็ม (แบบมีภาพ)
  1. ' / --------------------------------------------------------------------------------
  2. ' / Developer : Mr.Surapon Yodsanga (Thongkorn Tubtimkrob)
  3. ' / eMail : thongkorn@hotmail.com
  4. ' / URL: http://www.g2gnet.com (Khon Kaen - Thailand)
  5. ' / Facebook: https://www.facebook.com/g2gnet (For Thailand)
  6. ' / Facebook: https://www.facebook.com/commonindy (Worldwide)
  7. ' / Purpose: Keep personal information within the workplace.
  8. ' / Microsoft Visual Basic .NET (2010) & MS Access 2007+
  9. ' /
  10. ' / This is open source code under @CopyLeft by Thongkorn Tubtimkrob.
  11. ' / You can modify and/or distribute without to inform the developer.
  12. ' / --------------------------------------------------------------------------------
  13. Imports System.Data.OleDb
  14. Imports System.Drawing
  15. Imports System.IO

  16. Public Class frmContactPerson
  17.     Dim PK As Integer   '// Primary Key
  18.     Dim NewData As Boolean = False  '//
  19.     '//
  20.     Dim newFileName As String   '// File name of Image (New)
  21.     Dim orgPicName As String    '// Orginal of Image
  22.     Dim streamPic As Stream     '// Use Stream instead IO.

  23.     Private Sub frmContactPerson_FormClosing(sender As Object, e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
  24.         Dim Result As Byte = MessageBox.Show("Are you sure you want to exit the program?", "Confirm closing program", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2)
  25.         If Result = DialogResult.Yes Then
  26.             Me.Dispose()
  27.             If Conn.State = ConnectionState.Open Then Conn.Close()
  28.             Application.Exit()
  29.         Else
  30.             e.Cancel = True
  31.         End If
  32.     End Sub

  33.     ' / --------------------------------------------------------------------------------
  34.     Private Sub frmContactPerson_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
  35.         Call ConnectDataBase()
  36.         lblRecordCount.Text = ""
  37.         Call NewMode()
  38.         Call SetupDGVData()
  39.         Call RetrieveData()
  40.         '// Show picture
  41.         chkPicture.Checked = True
  42.     End Sub

  43.     ' / --------------------------------------------------------------------------------
  44.     Private Sub frmContactPerson_FormClosed(sender As Object, e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
  45.         If Conn.State = ConnectionState.Open Then Conn.Close()
  46.         Conn.Dispose()
  47.         Me.Dispose()
  48.         Application.Exit()
  49.     End Sub

  50.     ' / --------------------------------------------------------------------------------
  51.     '// Initialize DataGridView @Run Time
  52.     Private Sub SetupDGVData()
  53.         With dgvData
  54.             .RowHeadersVisible = False
  55.             .AllowUserToAddRows = False
  56.             .AllowUserToDeleteRows = False
  57.             .AllowUserToResizeRows = False
  58.             .MultiSelect = False
  59.             .SelectionMode = DataGridViewSelectionMode.FullRowSelect
  60.             .ReadOnly = True
  61.             .Font = New Font("Tahoma", 9)
  62.             ' Columns Specified
  63.             .Columns.Add("ContactPK", "ContactPK")
  64.             .Columns.Add("Fullname", "Full name")
  65.             .Columns.Add("Nickname", "Nickname")
  66.             .Columns.Add("PositionName", "Position")
  67.             .Columns.Add("DepartmentName", "Department")
  68.             .Columns.Add("Mobile", "Mobile")
  69.             .Columns.Add("Phone", "Phone Ext.")
  70.             .Columns.Add("Email", "Email")
  71.             .Columns.Add("LineID", "Line")
  72.             .Columns.Add("FacebookID", "Facebook")
  73.             '// Column Picture
  74.             Dim colPicture As New DataGridViewImageColumn
  75.             .Columns.Add(colPicture)
  76.             With colPicture
  77.                 .HeaderText = "Picture"
  78.                 .Name = "PictureName"
  79.                 .ImageLayout = DataGridViewImageCellLayout.Stretch
  80.             End With
  81.             '//
  82.             .Columns.Add("Note", "Note")
  83.             '// Hidden Columns
  84.             .Columns(0).Visible = False
  85.             .Columns(7).Visible = False
  86.             .Columns(8).Visible = False
  87.             .Columns(9).Visible = False
  88.             '// PictureName
  89.             .Columns("PictureName").Visible = True
  90.             .Columns("Note").Visible = False
  91.             ' Autosize Column
  92.             .AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill
  93.             .AutoResizeColumns()
  94.             '// Even-Odd Color
  95.             .AlternatingRowsDefaultCellStyle.BackColor = Color.AliceBlue
  96.             ' Adjust Header Styles
  97.             With .ColumnHeadersDefaultCellStyle
  98.                 .BackColor = Color.Navy
  99.                 .ForeColor = Color.Black ' Color.White
  100.                 .Font = New Font("Tahoma", 9, FontStyle.Bold)
  101.             End With
  102.         End With
  103.     End Sub

  104.     ' / --------------------------------------------------------------------------------
  105.     ' / Collect all searches and impressions. Come in the same place
  106.     ' / blnSearch = True, Show that the search results.
  107.     ' / blnSearch is set to False, Show all records.
  108.     Private Sub RetrieveData(Optional ByVal blnSearch As Boolean = False)
  109.         strSQL = _
  110.             " SELECT tblContact.ContactPK, tblContact.Fullname, tblContact.Nickname, tblContact.Mobile, " & _
  111.             " tblContact.Phone, tblContact.eMail, tblContact.LineID, tblContact.FacebookID, " & _
  112.             " tblContact.PictureName, tblContact.Note, " & _
  113.             " tblPosition.PositionName, tblDepartment.DepartmentName " & _
  114.             " FROM [tblPosition] INNER JOIN (tblDepartment INNER JOIN tblContact ON " & _
  115.             " tblDepartment.DepartmentPK = tblContact.DepartmentFK) ON tblPosition.PositionPK = tblContact.PositionFK "

  116.         '// blnSearch = True for Serach
  117.         If blnSearch Then
  118.             strSQL = strSQL & _
  119.                 " WHERE " & _
  120.                 " [Fullname] " & " Like '%" & txtSearch.Text & "%'" & " OR " & _
  121.                 " [Nickname] " & " Like '%" & txtSearch.Text & "%'" & " OR " & _
  122.                 " [PositionName] " & " Like '%" & txtSearch.Text & "%'" & " OR " & _
  123.                 " [DepartmentName] " & " Like '%" & txtSearch.Text & "%'" & " OR " & _
  124.                 " [Mobile] " & " Like '%" & txtSearch.Text & "%'" & " OR " & _
  125.                 " [Phone] " & " Like '%" & txtSearch.Text & "%'" & " OR " & _
  126.                 " [eMail] " & " Like '%" & txtSearch.Text & "%'" & " OR " & _
  127.                 " [LineID] " & " Like '%" & txtSearch.Text & "%'" & " OR " & _
  128.                 " [FaceBookID] " & " Like '%" & txtSearch.Text & "%'" & _
  129.                 " ORDER BY ContactPK "
  130.         Else
  131.             strSQL = strSQL & " ORDER BY ContactPK "
  132.         End If
  133.         '//
  134.         Try
  135.             Cmd = New OleDbCommand
  136.             If Conn.State = ConnectionState.Closed Then Conn.Open()
  137.             Cmd.Connection = Conn
  138.             Cmd.CommandText = strSQL
  139.             Dim DR As OleDbDataReader = Cmd.ExecuteReader
  140.             Dim i As Long = dgvData.RowCount
  141.             While DR.Read
  142.                 With dgvData
  143.                     .Rows.Add(i)
  144.                     .Rows(i).Cells(0).Value = DR.Item("ContactPK").ToString
  145.                     .Rows(i).Cells(1).Value = DR.Item("Fullname").ToString
  146.                     .Rows(i).Cells(2).Value = DR.Item("Nickname").ToString
  147.                     .Rows(i).Cells(3).Value = DR.Item("PositionName").ToString
  148.                     .Rows(i).Cells(4).Value = DR.Item("DepartmentName").ToString
  149.                     .Rows(i).Cells(5).Value = DR.Item("Mobile").ToString
  150.                     .Rows(i).Cells(6).Value = DR.Item("Phone").ToString
  151.                     .Rows(i).Cells(7).Value = DR.Item("eMail").ToString
  152.                     .Rows(i).Cells(8).Value = DR.Item("LineID").ToString
  153.                     .Rows(i).Cells(9).Value = DR.Item("FaceBookID").ToString
  154.                     '// Show picture in cell.
  155.                     If DR.Item("PictureName").ToString <> "" Then
  156.                         '//dgvData.Rows(i).Height = 75
  157.                         '// Column 10 = "PictureName"
  158.                         dgvData.Columns(10).Width = 75
  159.                         '// First, before load data into DataGrid and check File exists or not?
  160.                         If Dir(strPathImages & DR.Item("PictureName").ToString) = "" Then
  161.                             '// strPathImages in modDataBase.vb
  162.                             dgvData.Rows(i).Cells(10).Value = Image.FromFile(strPathImages & "people.png")
  163.                         Else
  164.                             dgvData.Rows(i).Cells(10).Value = Image.FromFile(strPathImages & DR.Item("PictureName").ToString)
  165.                         End If
  166.                     Else
  167.                         dgvData.Rows(i).Cells(10).Value = Image.FromFile(strPathImages & "people.png")
  168.                         '//dgvData.Rows(i).Height = 75
  169.                         dgvData.Columns(10).Width = 75
  170.                     End If
  171.                     newFileName = DR.Item("PictureName").ToString
  172.                     ' / --------------------------------------------------------------------------------
  173.                     '// Keep picture's name into TAG for each cell in DataGrid.
  174.                     '// Used when to display in PictureBox.
  175.                     dgvData.Rows(i).Cells(10).Tag = DR.Item("PictureName").ToString
  176.                     ' / --------------------------------------------------------------------------------
  177.                     '//
  178.                     .Rows(i).Cells(11).Value = DR.Item("Note").ToString
  179.                 End With
  180.                 i += 1
  181.             End While
  182.             newFileName = Nothing   '// Clear value
  183.             lblRecordCount.Text = "[Total : " & dgvData.RowCount & " records]"
  184.             DR.Close()
  185.             '// Adjust row height.
  186.             If chkPicture.Checked Then
  187.                 dgvData.Columns("PictureName").Visible = True
  188.                 '// Jump to sub program
  189.                 Call AdjustRowHeight(75)
  190.             Else
  191.                 dgvData.Columns("PictureName").Visible = False
  192.                 Call AdjustRowHeight(28)
  193.             End If

  194.         Catch ex As Exception
  195.             MessageBox.Show(ex.Message)
  196.         End Try
  197.         '//
  198.         txtSearch.Clear()
  199.     End Sub

  200.     ' / --------------------------------------------------------------------------------
  201.     ' / Double click to edit item.
  202.     Private Sub dgvData_DoubleClick(sender As Object, e As System.EventArgs) Handles dgvData.DoubleClick
  203.         '// If you add / edit information should be reminded before.
  204.         If btnDelete.Text = "Cancel" Then
  205.             txtFullname.Focus()
  206.             Exit Sub
  207.         End If
  208.         '//
  209.         If dgvData.RowCount <= 0 Then Return
  210.         '// Read the value of the focus row.
  211.         Dim iRow As Integer = dgvData.CurrentRow.Index
  212.         '//
  213.         PK = dgvData.Item(0, iRow).Value  '// Keep Primary Key
  214.         '// If you share a file, you need to refresh the data.
  215.         strSQL = _
  216.             " SELECT tblContact.ContactPK, tblContact.Fullname, tblContact.Nickname, tblContact.Mobile, " & _
  217.             " tblContact.Phone, tblContact.eMail, tblContact.LineID, tblContact.FacebookID, " & _
  218.             " tblContact.PictureName, tblContact.Note, " & _
  219.             " tblPosition.PositionName, tblDepartment.DepartmentName " & _
  220.             " FROM [tblPosition] INNER JOIN (tblDepartment INNER JOIN tblContact ON " & _
  221.             " tblDepartment.DepartmentPK = tblContact.DepartmentFK) ON tblPosition.PositionPK = tblContact.PositionFK " & _
  222.             " WHERE ContactPK = " & PK
  223.         If Conn.State = ConnectionState.Closed Then Conn.Open()
  224.         DA = New OleDbDataAdapter(strSQL, Conn)
  225.         DS = New DataSet
  226.         DA.Fill(DS)
  227.         '/ ------------------------------------------------------------------
  228.         With DS.Tables(0)
  229.             txtFullname.Text = "" & .Rows(0)("Fullname").ToString()
  230.             '// Keep the original value for later comparison.
  231.             txtFullname.Tag = txtFullname.Text
  232.             '// Using Double quote "" for trap error null value
  233.             txtNickname.Text = "" & .Rows(0)("Nickname").ToString()
  234.             ' / --------------------------------------------------------------------------------
  235.             '// Load data Detail Table into ComboBox
  236.             Call PopulateComboBox(cmbPosition, "tblPosition", "PositionName", "PositionPK")
  237.             cmbPosition.Text = "" & dgvData.Item(3, iRow).Value
  238.             Call PopulateComboBox(cmbDepartment, "tblDepartment", "DepartmentName", "DepartmentPK")
  239.             cmbDepartment.Text = "" & dgvData.Item(4, iRow).Value
  240.             '//
  241.             txtMobile.Text = "" & .Rows(0)("Mobile").ToString()
  242.             txtPhone.Text = "" & .Rows(0)("Phone").ToString()
  243.             txtEMail.Text = "" & .Rows(0)("EMail").ToString()
  244.             txtLineID.Text = "" & .Rows(0)("LineID").ToString()
  245.             txtFacebookID.Text = "" & .Rows(0)("FacebookID").ToString()
  246.             txtNote.Text = "" & .Rows(0)("Note").ToString()
  247.             '// Load Picture
  248.             Call ShowPicture(.Rows(0)("PictureName").ToString)
  249.         End With
  250.         DS.Dispose()
  251.         DA.Dispose()
  252.         '// Change to Edit Mode
  253.         NewData = False
  254.         EditMode()
  255.     End Sub

  256.     ' / --------------------------------------------------------------------------------
  257.     ' / You can press enter to select row.
  258.     Private Sub dgvData_KeyDown(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles dgvData.KeyDown
  259.         If e.KeyCode = Keys.Enter Then
  260.             Call dgvData_DoubleClick(sender, e)
  261.             ' No move to next row.
  262.             e.SuppressKeyPress = True
  263.         End If
  264.     End Sub

  265.     ' / --------------------------------------------------------------------------------
  266.     ' / Load table detail into ComboBox
  267.     Public Sub PopulateComboBox(cmbCtrl As ComboBox, strTable As String, strFieldName As String, Optional ByVal strFieldPK As String = vbNullString)
  268.         Try
  269.             If Conn.State = ConnectionState.Closed Then Conn.Open()
  270.             strStmt = "SELECT * FROM " & strTable & " ORDER BY " & strFieldName
  271.             Cmd = New OleDb.OleDbCommand(strStmt, Conn)
  272.             DR = Cmd.ExecuteReader
  273.             Dim DT As DataTable = New DataTable
  274.             DT.Load(DR)
  275.             '/ Primary Key (ValueMember)
  276.             cmbCtrl.ValueMember = strFieldPK
  277.             '/ Display the name
  278.             cmbCtrl.DisplayMember = strFieldName
  279.             cmbCtrl.DataSource = DT
  280.             '// Autocomplete
  281.             With cmbCtrl
  282.                 .DropDownStyle = ComboBoxStyle.DropDown
  283.                 .AutoCompleteMode = AutoCompleteMode.Suggest
  284.                 .AutoCompleteSource = AutoCompleteSource.ListItems
  285.             End With
  286.             DR.Close()
  287.             Conn.Close()
  288.         Catch ex As Exception
  289.             MessageBox.Show(ex.Message)
  290.         End Try
  291.     End Sub

  292.     ' / --------------------------------------------------------------------------------
  293.     ' / Add New Mode
  294.     ' / --------------------------------------------------------------------------------
  295.     Private Sub NewMode()
  296.         '// Clear all TextBox.
  297.         For Each c In GroupBox1.Controls
  298.             If TypeOf c Is TextBox Then
  299.                 DirectCast(c, TextBox).Clear()
  300.                 DirectCast(c, TextBox).Enabled = False
  301.             End If
  302.         Next
  303.         '// Clear all ComboBox
  304.         For Each cbo In GroupBox1.Controls.OfType(Of ComboBox)()
  305.             cbo.Enabled = False
  306.         Next
  307.         '//
  308.         btnAdd.Enabled = True
  309.         btnSave.Enabled = False
  310.         btnDelete.Enabled = True
  311.         btnDelete.Text = "Delete"
  312.         btnExit.Enabled = True
  313.         '//
  314.         btnBrowse.Enabled = False
  315.         btnDeleteImg.Enabled = False
  316.         picData.Image = Image.FromFile(strPathImages & "people.png")
  317.     End Sub

  318.     ' / --------------------------------------------------------------------------------
  319.     ' / Edit Data Mode
  320.     Private Sub EditMode()
  321.         '// Clear all TextBox
  322.         For Each c In GroupBox1.Controls
  323.             If TypeOf c Is TextBox Then
  324.                 DirectCast(c, TextBox).Enabled = True
  325.             End If
  326.         Next
  327.         '// Clear all ComboBox
  328.         For Each cbo In GroupBox1.Controls.OfType(Of ComboBox)()
  329.             cbo.Enabled = True
  330.         Next
  331.         btnAdd.Enabled = False
  332.         btnSave.Enabled = True
  333.         btnDelete.Enabled = True
  334.         btnDelete.Text = "Cancel"
  335.         btnExit.Enabled = False
  336.         '//
  337.         btnBrowse.Enabled = True
  338.         btnDeleteImg.Enabled = True
  339.     End Sub

  340.     ' / --------------------------------------------------------------------------------
  341.     Private Sub btnSave_Click(sender As System.Object, e As System.EventArgs) Handles btnSave.Click
  342.         '// Validate Data
  343.         If txtFullname.Text = "" Or IsNothing(txtFullname.Text) Or txtFullname.Text.Length = 0 Then
  344.             MessageBox.Show("Full name cannot be empty.", "Report Status", _
  345.                             MessageBoxButtons.OK, MessageBoxIcon.Warning)
  346.             txtFullname.Focus()
  347.             Exit Sub
  348.         End If
  349.         '//
  350.         '// If the new value (Text) with the original value (Tag) is not equal, then the value changed in field "Fullname"
  351.         If txtFullname.Text.ToLower <> LCase(txtFullname.Tag) Then
  352.             strSQL = _
  353.             " SELECT Count(tblContact.Fullname) AS CountFullname FROM tblContact " & _
  354.             " WHERE Fullname = " & "'" & txtFullname.Text & "'"
  355.             If DuplicateName(strSQL) Then
  356.                 MessageBox.Show("Duplicate Full name, please enter new value.", "Report Status", _
  357.                                 MessageBoxButtons.OK, MessageBoxIcon.Warning)
  358.                 txtFullname.Focus()
  359.                 Exit Sub
  360.             End If
  361.         End If
  362.         '// NewData = True, It's Add New Mode
  363.         If NewData Then
  364.             strSQL = _
  365.                 " INSERT INTO tblContact(" & _
  366.                 " ContactPK, Fullname, Nickname, PositionFK, DepartmentFK, Mobile, Phone, Email, LineID, FacebookID, " & _
  367.                 " PictureName, [Note], " & _
  368.                 " DateAdded, DateModified) " & _
  369.                 " VALUES(" & _
  370.                 "'" & SetupNewPK() & "'," & _
  371.                 "'" & txtFullname.Text & "'," & _
  372.                 "'" & txtNickname.Text & "'," & _
  373.                 "'" & PKComboBox(cmbPosition, "tblPosition", "PositionName", "PositionPK") & "'," & _
  374.                 "'" & PKComboBox(cmbDepartment, "tblDepartment", "DepartmentName", "DepartmentPK") & "'," & _
  375.                 "'" & txtMobile.Text & "'," & _
  376.                 "'" & txtPhone.Text & "'," & _
  377.                 "'" & txtEMail.Text & "'," & _
  378.                 "'" & txtLineID.Text & "'," & _
  379.                 "'" & txtFacebookID.Text & "'," & _
  380.                 "'" & GetFileImages() & "'," & _
  381.                 "'" & txtNote.Text & "'," & _
  382.                 "'" & Now.ToString("dd/MM/yyyy") & "'," & _
  383.                 "'" & Now.ToString("dd/MM/yyyy") & "'" & _
  384.                 ")"
  385.             '// EDIT MODE
  386.         Else
  387.             '// START UPDATE
  388.             strSQL = _
  389.                 " UPDATE tblContact SET " & _
  390.                 " [Fullname]='" & txtFullname.Text & "', " & _
  391.                 " [Nickname]='" & txtNickname.Text & "', " & _
  392.                 " [PositionFK]=" & PKComboBox(cmbPosition, "tblPosition", "PositionName", "PositionPK") & ", " & _
  393.                 " [DepartmentFK]=" & PKComboBox(cmbDepartment, "tblDepartment", "DepartmentName", "DepartmentPK") & ", " & _
  394.                 " [Mobile]='" & txtMobile.Text & "', " & _
  395.                 " [Phone]='" & txtPhone.Text & "', " & _
  396.                 " [Email]='" & txtEMail.Text & "', " & _
  397.                 " [LineID]='" & txtLineID.Text & "', " & _
  398.                 " [FaceBookID]='" & txtFacebookID.Text & "', " & _
  399.                 " [PictureName]='" & GetFileImages() & "', " & _
  400.                 " [Note]='" & txtNote.Text & "', " & _
  401.                 " [DateModified]='" & Now.ToString("dd/MM/yyyy") & "'" & _
  402.                 " WHERE ContactPK = " & PK & ""
  403.         End If
  404.         '// Insert or Update same as operation
  405.         If DoSQL(strSQL) Then
  406.             MessageBox.Show("Records Updated Completed.", "Update Status", MessageBoxButtons.OK, MessageBoxIcon.Information)
  407.         End If
  408.         '//
  409.         cmbPosition.SelectedIndex = 0
  410.         cmbDepartment.SelectedIndex = 0

  411.         '// Clear rows in DataGridView
  412.         dgvData.Rows.Clear()
  413.         '// Refresh DataGridView
  414.         Call RetrieveData()
  415.         '// Add New Mode
  416.         Call NewMode()
  417.     End Sub

  418.     ' / --------------------------------------------------------------------------------
  419.     '// UPDATE DATA
  420.     Private Function DoSQL(ByVal Sql As String) As Boolean
  421.         Cmd = New OleDb.OleDbCommand
  422.         If Conn.State = ConnectionState.Closed Then Conn.Open()
  423.         'MsgBox(Sql)
  424.         Try
  425.             Cmd.Connection = Conn
  426.             Cmd.CommandType = CommandType.Text
  427.             Cmd.CommandText = Sql
  428.             Cmd.ExecuteNonQuery()
  429.             Cmd.Dispose()
  430.             Return True
  431.         Catch ex As Exception
  432.             MsgBox("Error Update: " & ex.Message)
  433.             Return False
  434.         End Try
  435.     End Function

  436.     ' / --------------------------------------------------------------------------------
  437.     ' / Get Filename + Extesnsion only, not Path
  438.     Private Function GetFileImages() As String
  439.         '// Get the Filename + Extension only
  440.         Dim iArr() As String
  441.         iArr = Split(newFileName, "")
  442.         GetFileImages = iArr(UBound(iArr))
  443.         '//
  444.         '// If same original and new
  445.         If orgPicName = newFileName Then Return GetFileImages
  446.         Try
  447.             '// ------------- Copy File -------------
  448.             '// Determine whether the source file is real or not.
  449.             If System.IO.File.Exists(newFileName) = True Then
  450.                 ' Trap Error in the case source = destination
  451.                 If LCase(strPathImages + GetFileImages) <> LCase(newFileName) Then
  452.                     '// Copy the Source file (newFileName) to the Destination (DestFile).
  453.                     '// If the same file is found, overwrite (OverWrite = True).
  454.                     System.IO.File.Copy(newFileName, strPathImages + GetFileImages, True)
  455.                 End If
  456.             End If
  457.             newFileName = Nothing
  458.         Catch ex As Exception
  459.             MessageBox.Show(ex.Message)
  460.         End Try
  461.     End Function

  462.     ' / --------------------------------------------------------------------------------
  463.     ' / Function to find and create the new Primary Key not to duplicate.
  464.     Function SetupNewPK() As Long
  465.         strSQL = _
  466.             " SELECT MAX(tblContact.ContactPK) AS MaxPK FROM tblContact "
  467.         If Conn.State = ConnectionState.Closed Then Conn.Open()
  468.         Cmd = New OleDb.OleDbCommand(strSQL, Conn)
  469.         '/ Check if the information is available. And return it back
  470.         If IsDBNull(Cmd.ExecuteScalar) Then
  471.             '// Start at 1
  472.             SetupNewPK = 1
  473.         Else
  474.             SetupNewPK = Cmd.ExecuteScalar + 1
  475.         End If
  476.     End Function

  477.     ' / --------------------------------------------------------------------------------
  478.     ' / This example uses the Fullname validation.
  479.     Public Function DuplicateName(ByVal Sql As String) As Boolean
  480.         If Conn.State = ConnectionState.Closed Then Conn.Open()
  481.         Cmd = New OleDb.OleDbCommand(Sql, Conn)
  482.         '// Return count records
  483.         DuplicateName = Cmd.ExecuteScalar
  484.     End Function

  485.     ' / --------------------------------------------------------------------------------
  486.     ' / Function insert new data in Detail Table and return Primary Key for Master Table.
  487.     Function PKComboBox(cmbCtrl As ComboBox, strTable As String, strFieldName As String, Optional ByVal strFieldPK As String = vbNullString) As Integer
  488.         '// If ComboBox is blank data then return 1 (Blank Data)
  489.         If cmbCtrl.Text = "" Or cmbCtrl.Text.Length = 0 Or IsDBNull(cmbCtrl.Text) Then
  490.             'PKComboBox = 1
  491.             Return 1
  492.         End If
  493.         strSQL = _
  494.             "SELECT * FROM " & strTable & " WHERE " & strFieldName & " = " & "'" & cmbCtrl.Text & "'"
  495.         If Conn.State = ConnectionState.Closed Then Conn.Open()
  496.         Cmd = New OleDb.OleDbCommand(strSQL, Conn)
  497.         '// Get the Primary Key
  498.         Dim cmbPK As Integer = Cmd.ExecuteScalar
  499.         '// If not have in Detail Table
  500.         If cmbPK <= 0 Then
  501.             strStmt = _
  502.                 " SELECT MAX(" & strFieldPK & ") AS MaxPK FROM " & strTable
  503.             If Conn.State = ConnectionState.Closed Then Conn.Open()
  504.             Cmd = New OleDb.OleDbCommand(strStmt, Conn)
  505.             '// Increment Primary Key with 1, and Return this value.
  506.             PKComboBox = Cmd.ExecuteScalar + 1
  507.             '/ Add New Data in Detail Table
  508.             Try
  509.                 Using Comm As New OleDb.OleDbCommand()
  510.                     With Comm
  511.                         .Connection = Conn
  512.                         .CommandType = CommandType.Text
  513.                         .CommandText = _
  514.                             " INSERT INTO " & strTable & " (" & strFieldName & ", " & strFieldPK & ") VALUES (@DName, @DPK)"
  515.                         With .Parameters
  516.                             .Add("@DName", OleDbType.VarChar).Value = cmbCtrl.Text
  517.                             '/ ------------------------------------------------------------------
  518.                             .Add("@DPK", OleDbType.Integer).Value = PKComboBox
  519.                             '/ ------------------------------------------------------------------
  520.                         End With
  521.                         ' Insert new record.
  522.                         .ExecuteNonQuery()
  523.                         .Parameters.Clear()
  524.                         '/ ------------------------------------------------------------------
  525.                     End With
  526.                 End Using
  527.             Catch ex As Exception
  528.                 MessageBox.Show(ex.Message)
  529.             End Try
  530.         Else
  531.             '// Return
  532.             PKComboBox = cmbPK
  533.         End If
  534.         Cmd.Dispose()
  535.     End Function

  536.     '/ ------------------------------------------------------------------
  537.     '// Load Detail Table into ComboBox
  538.     Private Sub btnAdd_Click(sender As System.Object, e As System.EventArgs) Handles btnAdd.Click
  539.         NewData = True  '// Add New Mode
  540.         Call EditMode()
  541.         '// Load Detail Table into ComboBox
  542.         Call PopulateComboBox(cmbPosition, "tblPosition", "PositionName", "PositionPK")
  543.         Call PopulateComboBox(cmbDepartment, "tblDepartment", "DepartmentName", "DepartmentPK")
  544.         '//
  545.         picData.Image = Image.FromFile(strPathImages & "people.png")
  546.         txtFullname.Focus()
  547.     End Sub

  548.     '// Load Detail Table into ComboBox
  549.     Private Sub btnDelete_Click(sender As System.Object, e As System.EventArgs) Handles btnDelete.Click
  550.         '// If Edit Data Mode
  551.         If btnDelete.Text = "Cancel" Then
  552.             btnAdd.Enabled = True
  553.             btnSave.Enabled = True
  554.             btnDelete.Enabled = True
  555.             btnDelete.Text = "Delete"
  556.             btnExit.Enabled = True
  557.             '//
  558.             btnBrowse.Enabled = False
  559.             btnDeleteImg.Enabled = False
  560.             '//
  561.             cmbPosition.SelectedIndex = -1
  562.             cmbDepartment.SelectedIndex = -1
  563.             picData.Image = Image.FromFile(strPathImages & "people.png")
  564.             NewMode()
  565.         Else
  566.             If dgvData.RowCount = 0 Then Exit Sub
  567.             '// Receive Primary Key value to confirm the deletion.
  568.             Dim iRow As Long = dgvData.Item(0, dgvData.CurrentRow.Index).Value
  569.             Dim FName As String = dgvData.Item(1, dgvData.CurrentRow.Index).Value
  570.             Dim Result As Byte = MessageBox.Show("Are you sure you want to delete the data?" & vbCrLf & "Full Name: " & FName, "Confirm Deletion", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2)
  571.             If Result = DialogResult.Yes Then
  572.                 '// iRow is the ContactPK or Primary key that is hidden.
  573.                 strStmt = " DELETE FROM tblContact WHERE ContactPK = " & iRow
  574.                 '// UPDATE RECORD
  575.                 DoSQL(strStmt)
  576.                 '//
  577.                 '// Check if use default image.
  578.                 If UCase(InStrRev(strPathImages & dgvData.Item(10, dgvData.CurrentRow.Index).ToString, "")) <> "people.png" Then
  579.                     '// Remove original picture from Column 10 in DataGridView (strPathImages from modDataBase.vb)
  580.                     Dim strPicName As String = strPathImages & dgvData.Item(10, dgvData.CurrentRow.Index).ToString
  581.                     If strPicName IsNot Nothing Then
  582.                         If System.IO.File.Exists(strPicName) = True Then
  583.                             System.IO.File.Delete(strPicName)
  584.                             strPicName = Nothing
  585.                         End If
  586.                     End If
  587.                 End If
  588.                 '//
  589.                 Call NewMode()
  590.                 '//
  591.                 dgvData.Rows.Clear()
  592.                 Call RetrieveData()
  593.             End If
  594.         End If
  595.     End Sub

  596.     Private Sub btnRefresh_Click(sender As System.Object, e As System.EventArgs) Handles btnRefresh.Click
  597.         dgvData.Rows.Clear()
  598.         Call RetrieveData()
  599.     End Sub

  600.     Private Sub txtSearch_KeyPress(sender As Object, e As System.Windows.Forms.KeyPressEventArgs) Handles txtSearch.KeyPress
  601.         '// Undesirable characters for the database ex.  ', * or %
  602.         txtSearch.Text = Replace(Trim(txtSearch.Text), "'", "")
  603.         txtSearch.Text = Replace(Trim(txtSearch.Text), "%", "")
  604.         txtSearch.Text = Replace(Trim(txtSearch.Text), "*", "")
  605.         If Trim(txtSearch.Text) = "" Or Len(Trim(txtSearch.Text)) = 0 Then Exit Sub
  606.         ' RetrieveData(True) It means searching for information.
  607.         If e.KeyChar = Chr(13) Then '// Press Enter
  608.             '// No beep.
  609.             e.Handled = True
  610.             '//
  611.             dgvData.Rows.Clear()
  612.             Call RetrieveData(True)
  613.         End If
  614.     End Sub

  615.     Private Sub btnBrowse_Click(sender As System.Object, e As System.EventArgs) Handles btnBrowse.Click
  616.         Dim dlgImage As OpenFileDialog = New OpenFileDialog()

  617.         ' / Open File Dialog
  618.         With dlgImage
  619.             .InitialDirectory = strPathImages
  620.             .Title = "Select images"
  621.             .Filter = "Images types (*.jpg;*.png;*.gif;*.bmp)|*.jpg;*.png;*.gif;*.bmp"
  622.             .FilterIndex = 1
  623.             .RestoreDirectory = True
  624.         End With
  625.         ' Select OK after Browse ...
  626.         If dlgImage.ShowDialog() = DialogResult.OK Then
  627.             '// New Image
  628.             newFileName = dlgImage.FileName
  629.             picData.Image = Image.FromFile(newFileName)
  630.         End If
  631.     End Sub

  632.     Private Sub btnDeleteImg_Click(sender As System.Object, e As System.EventArgs) Handles btnDeleteImg.Click
  633.         If orgPicName = "" Or orgPicName.Length = 0 Then Return
  634.         '//
  635.         picData.Image = Image.FromFile(strPathImages & "people.png")
  636.         newFileName = ""
  637.     End Sub

  638.     ' / -----------------------------------------------------------------------------
  639.     ' / Use Steam instead IO.
  640.     ' / -----------------------------------------------------------------------------
  641.     Sub ShowPicture(PicName As String)
  642.         Dim imgDB As Image
  643.         ' Get the name of the image file from the database.
  644.         If PicName.ToString <> "" Then
  645.             ' Verify that the image file meets the specified location.
  646.             If System.IO.File.Exists(strPathImages & PicName.ToString) Then
  647.                 ' Because when deleting the image file is locked, it can not be removed.
  648.                 ' The file is closed after the image is loaded, so you can delete the file if you need to
  649.                 streamPic = File.OpenRead(strPathImages & PicName.ToString)
  650.                 imgDB = Image.FromStream(streamPic)
  651.                 picData.Image = imgDB
  652.                 ' Keep the original image file name. If it is recorded, it will be removed.
  653.                 orgPicName = strPathImages & PicName.ToString
  654.                 newFileName = orgPicName
  655.             Else
  656.                 ' No images were retrieved from the database.
  657.                 streamPic = File.OpenRead(strPathImages & "people.png")
  658.                 imgDB = Image.FromStream(streamPic)
  659.                 picData.Image = imgDB
  660.                 ' Keep image filename blank.
  661.                 orgPicName = ""
  662.                 newFileName = ""
  663.             End If
  664.             ' Is null
  665.         Else
  666.             streamPic = File.OpenRead(strPathImages & "people.png")
  667.             imgDB = Image.FromStream(streamPic)
  668.             picData.Image = imgDB
  669.             ' Keep image filename blank.
  670.             orgPicName = ""
  671.             newFileName = ""

  672.         End If
  673.         '//
  674.         streamPic.Dispose()
  675.         DR.Close()
  676.         Cmd.Dispose()
  677.         Conn.Close()
  678.     End Sub

  679.     Private Sub cmbDepartment_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmbDepartment.SelectedIndexChanged
  680.         '
  681.     End Sub

  682.     Private Sub dgvData_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgvData.CellContentClick
  683.         '
  684.     End Sub

  685.     Private Sub btnExit_Click(sender As System.Object, e As System.EventArgs) Handles btnExit.Click
  686.         Me.Close()
  687.     End Sub

  688.     ' / -----------------------------------------------------------------------------
  689.     ' / Show picture or not?
  690.     ' / -----------------------------------------------------------------------------
  691.     Private Sub chkPicture_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles chkPicture.CheckedChanged
  692.         If chkPicture.Checked Then
  693.             dgvData.Columns("PictureName").Visible = True
  694.             Call AdjustRowHeight(75)
  695.         Else
  696.             dgvData.Columns("PictureName").Visible = False
  697.             Call AdjustRowHeight(28)
  698.         End If
  699.     End Sub

  700.     ' / -----------------------------------------------------------------------------
  701.     ' / Change the height of the rows.
  702.     ' / -----------------------------------------------------------------------------
  703.     Private Sub AdjustRowHeight(h As Integer)
  704.         For i As Integer = 0 To dgvData.Rows.Count - 1
  705.             dgvData.Rows(i).Height = h
  706.         Next
  707.     End Sub
  708. End Class
คัดลอกไปที่คลิปบอร์ด
ดาวน์โหลดโค้ดโปรแกรมต้นฉบับ VB.NET (2010) ได้ที่นี่ (แบบไม่มีภาพ)
ดาวน์โหลดโค้ดโปรแกรมต้นฉบับ VB.NET (2010) ได้ที่นี่ (แบบมีภาพ)

ขออภัย! โพสต์นี้มีไฟล์แนบหรือรูปภาพที่ไม่ได้รับอนุญาตให้คุณเข้าถึง

คุณจำเป็นต้อง ลงชื่อเข้าใช้ เพื่อดาวน์โหลดหรือดูไฟล์แนบนี้ คุณยังไม่มีบัญชีใช่ไหม? ลงทะเบียน

x
สิ่งที่ดีกว่าการให้ คือการให้แบบไม่มีที่สิ้นสุด

308

กระทู้

498

โพสต์

5971

เครดิต

ผู้ดูแลระบบ

ทองก้อน ทับทิมกรอบ

Rank: 9Rank: 9Rank: 9

เครดิต
5971
 เจ้าของ| โพสต์ 2017-10-25 22:47:38 | ดูโพสต์ทั้งหมด

โมดูลหากิน ในการเชื่อมต่อกับฐานข้อมูล (modDataBase.vb)  ...
  1. Imports System.Data.OleDb
  2. Imports Microsoft.VisualBasic

  3. Module modDataBase
  4.     '// Declare variable one time but use many times.
  5.     Public Conn As OleDbConnection
  6.     Public Cmd As OleDbCommand
  7.     Public DS As DataSet
  8.     Public DR As OleDbDataReader
  9.     Public DA As OleDbDataAdapter
  10.     Public strSQL As String '// Major SQL
  11.     Public strStmt As String    '// Minor SQL

  12.     '// Data Path
  13.     Public strPathData As String = MyPath(Application.StartupPath)
  14.     '// Images Path
  15.     Public strPathImages As String = MyPath(Application.StartupPath)

  16.     Public Sub ConnectDataBase()
  17.         strPathData = MyPath(Application.StartupPath) & "Data"
  18.         strPathImages = MyPath(Application.StartupPath) & "Images"
  19.         Dim strConn As String = _
  20.             "Provider = Microsoft.ACE.OLEDB.12.0;" & _
  21.             "Data Source = " & strPathData & "Contact.accdb;"
  22.         Try
  23.             Conn = New OleDb.OleDbConnection(strConn)
  24.             Conn.Open()

  25.         Catch ex As Exception
  26.             MessageBox.Show(ex.Message, "Report Status", MessageBoxButtons.OK, MessageBoxIcon.Warning)
  27.             '// Force end of program.
  28.             End
  29.         End Try
  30.     End Function

  31.     ' / --------------------------------------------------------------------------------
  32.     ' / Get my project path
  33.     ' / AppPath = C:\My Project\bin\debug
  34.     ' / Replace "\bin\debug" with ""
  35.     ' / Return : C:\My Project\
  36.     Function MyPath(AppPath As String) As String
  37.         '/ MessageBox.Show(AppPath);
  38.         AppPath = AppPath.ToLower()
  39.         '/ Return Value
  40.         MyPath = AppPath.Replace("\bin\debug", "").Replace("\bin\release", "").Replace("\bin\x86\debug", "")
  41.         '// If not found folder then put the \ (BackSlash) or ASCII Code = 92 at the end.
  42.         If Right(MyPath, 1) <> Chr(92) Then MyPath = MyPath & Chr(92)
  43.     End Function
  44. End Module
คัดลอกไปที่คลิปบอร์ด


สิ่งที่ดีกว่าการให้ คือการให้แบบไม่มีที่สิ้นสุด

0

กระทู้

51

โพสต์

233

เครดิต

Full Member

Rank: 3Rank: 3

เครดิต
233
โพสต์ 2017-11-12 18:54:04 | ดูโพสต์ทั้งหมด

ขอบพระคุณมากครับอาจารย์

0

กระทู้

3

โพสต์

75

เครดิต

Member

Rank: 2

เครดิต
75
โพสต์ 2017-12-4 22:54:28 | ดูโพสต์ทั้งหมด

ขอบคุณมากครับ อาจารย์

0

กระทู้

2

โพสต์

18

เครดิต

Newbie

Rank: 1

เครดิต
18
โพสต์ 2018-1-4 09:04:23 | ดูโพสต์ทั้งหมด

ขอบคุณครับอาจารย์

0

กระทู้

3

โพสต์

64

เครดิต

Member

Rank: 2

เครดิต
64
โพสต์ 2018-1-16 12:16:38 | ดูโพสต์ทั้งหมด

ขอบคุณครับอาจารย์

1

กระทู้

12

โพสต์

155

เครดิต

Member

Rank: 2

เครดิต
155
โพสต์ 2018-3-14 22:09:38 | ดูโพสต์ทั้งหมด

ขอบคุณมากครับ

11

กระทู้

31

โพสต์

427

เครดิต

ผู้ดูแลบอร์ด

Rank: 7Rank: 7Rank: 7

เครดิต
427
โพสต์ 2018-5-3 20:28:55 | ดูโพสต์ทั้งหมด

แก้ไขครั้งสุดท้ายโดย puklit เมื่อ 2018-5-3 20:31

ผมขออนุญาตอาจารย์ทองก้อน เพิ่ม Option การนำข้อมูลออกไฟล์ Excel พร้อมรูปที่แสดงใน Datagridview ดังนี้ครับเนื่องจากผมคิดว่าน่าจะเป็นประโยชน์กับอีกหลายท่านที่ต้องใช้ไฟล์ข้อมูลและมีรูปประกอบด้วย

โดย Option นี้ ท่านที่สนใจจะต้อง Add reference Object Excel library เข้ามาใน Project ด้วยตามรูป
หมายเหตุ : เวอร์ชั่นของแต่ละเครื่องจะไม่เหมือนกันตามรุ่นที่ท่านลง MS Office


1. ปุ่ม Export file to Excel ที่เพิ่มขึ้นมาตามกรอบสีเขียว




2. หลังจากที่เลือกข้อมูลออกไฟล์ Excel ตาม Option ดังนี้
2.1 แสดงรูปใน Datagridview
รูปจะแสดงใน Cell ในแต่ละ Row ตาม Record ของข้อมูลในรูปแบบ Move and size with cell


กรณีที่กรอง (Fillter) ข้อมูล รูปจะแสดงตามที่กรองเท่านั้นจากการตั้งค่า Move and size with cell


2.2 หากเลือก Option ไม่แสดงรูปใน Datagridview จะแสดงผลลัพธ์ในไฟล์ Excel ดังนี้



โค้ดของ Option นี้อยู่ใน Class ClsExport_Excel ครับ

ทุกท่านที่สนใน Option นี้สามารถ[size=14.6667px]ดาวน์โหลดโค้ดได้ที่นี่



ขออภัย! โพสต์นี้มีไฟล์แนบหรือรูปภาพที่ไม่ได้รับอนุญาตให้คุณเข้าถึง

คุณจำเป็นต้อง ลงชื่อเข้าใช้ เพื่อดาวน์โหลดหรือดูไฟล์แนบนี้ คุณยังไม่มีบัญชีใช่ไหม? ลงทะเบียน

x

308

กระทู้

498

โพสต์

5971

เครดิต

ผู้ดูแลระบบ

ทองก้อน ทับทิมกรอบ

Rank: 9Rank: 9Rank: 9

เครดิต
5971
 เจ้าของ| โพสต์ 2018-5-6 10:00:06 | ดูโพสต์ทั้งหมด

ยอดเยี่ยมครับ ... นี่แหละคือความต้องการเป็นอย่างมากของผม พอผม (หรือใครก็ตามที) ที่เริ่มต้นให้ จากนั้นก็ช่วยๆกันไปทำการเพิ่มเติม แก้ไข ดัดแปลง หรือจะยำใหญ่ใส่อะไรมาก็แล้วแต่ที่คิดว่าเป็นประโยชน์ต่อสังคม จากนั้นก็ส่งกลับคืนมาให้ผม และคนอื่นๆได้เรียนรู้ศึกษา เป็นการแลกเปลี่ยนความรู้ ความคิดเห็นกัน ด้วยการใช้โค้ดจริงๆครับผม
สิ่งที่ดีกว่าการให้ คือการให้แบบไม่มีที่สิ้นสุด

0

กระทู้

1

โพสต์

4

เครดิต

Newbie

Rank: 1

เครดิต
4
โพสต์ 2018-5-31 10:32:43 | ดูโพสต์ทั้งหมด

ขอบคุณมากๆ ครับ
ขออภัย! คุณไม่ได้รับสิทธิ์ในการดำเนินการในส่วนนี้ กรุณาเลือกอย่างใดอย่างหนึ่ง ลงชื่อเข้าใช้ | ลงทะเบียน

รายละเอียดเครดิต

ข้อความล้วน|อุปกรณ์พกพา|ประวัติการแบน|G2GNet.com  

GMT+7, 2024-3-28 18:28 , Processed in 0.200291 second(s), 3 queries , File On.

Powered by Discuz! X3.4, Rev.62

Copyright © 2001-2020 Tencent Cloud.

ตอบกระทู้ ขึ้นไปด้านบน ไปที่หน้ารายการกระทู้