This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | Imports System.Data.SqlClient | |
| Imports System.Data.Sql | |
| Public Class nPagingData | |
| Public Property TombolFirst() As ToolStripButton | |
| Public Property TombolPrev() As ToolStripButton | |
| Public Property TombolNext() As ToolStripButton | |
| Public Property TombolLast() As ToolStripButton | |
| Public Property TextCurrentPage() As ToolStripTextBox | |
| Public Property TextTotalPage() As ToolStripTextBox | |
| '================================================== | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | Imports System.Data.Sql | |
| Imports System.Data.SqlClient | |
| Public Class PagingData | |
| Private Shared iMaxRow As Integer = 20 | |
| Private Shared iCurrentIndex As Integer | |
| Private Shared iTotalIndex As Integer | |
| Private Shared iCurrentPage As Integer | |
| Private Shared iTotalPage As Integer | |
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | Public Shared Sub ServerList(ByVal ComboInstance As ComboBox) | |
| Dim _server As String = String.Empty | |
| Dim _Instance = SqlDataSourceEnumerator.Instance | |
| Dim _Table = _Instance.GetDataSources | |
| For Each _row In _Table.Rows | |
| _server = String.Empty | |
| _server = If(_row("InstanceName").ToString.Length > 0, String.Format("{0}\{1}", _row("ServerName"), _row("InstanceName")), _row("ServerName")) | |
| ComboInstance.Items.Add(_server) | |
| Next | |
| End Sub | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | Public Shared Function _Excel2003(ByVal DataImport As DataGridView, ByVal _Path As String) As Double | |
| Dim _Conn As System.Data.OleDb.OleDbConnection | |
| Dim _dataSet As System.Data.DataSet | |
| Dim _dataAdapter As System.Data.OleDb.OleDbDataAdapter | |
| Dim _RowCount As Integer = 0 | |
| Dim _ColCount As Integer = 0 | |
| Dim _ItemCOunt As Long | |
| Dim _FieldCount As Integer | |
| Try | |
| _Conn = New System.Data.OleDb.OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0;Data Source='" + Trim(_Path) + "';Extended Properties=Excel 8.0;") | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click | |
| If Len(Trim(tPath.Text)) > 0 Then | |
| Dim _FileSize As String = "" | |
| Dim _Dir As New IO.DirectoryInfo(tPath.Text) | |
| Dim AryFi As IO.FileInfo() = _Dir.GetFiles("*.DBF") | |
| Dim Fi As IO.FileInfo | |
| Dim _ListItem As ListViewItem | |
| LvTable.Items.Clear() | |
| Dim i As Integer = 0 | |
| For Each Fi In AryFi | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | Private Sub Tombol() Handles Button1.Click | |
| Dim sPath As String | |
| OD.Filter = "DBF File (*.DBF)|*.Dbf" | |
| If OD.ShowDialog = Windows.Forms.DialogResult.OK Then | |
| sPath = OD.FileName 'get the path | |
| sPath = StrReverse(sPath) 'reverse the string | |
| sPath = Mid(sPath, InStr(sPath, "\"), Len(sPath)) 'extract from the first slash | |
| sPath = StrReverse(sPath) 'reverse it again | |
| tPath.Text = sPath | |
| End If | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | Private Sub _TampilData(ByVal _SQLQuery As String) | |
| Try | |
| Dim sConn As String = "Provider=VFPOLEDB.1;Data Source=" & tPath.Text & ";Password='';Collating Sequence=MACHINE" | |
| Dim oConn As OleDbConnection = New OleDbConnection(sConn) | |
| Dim oCmd As OleDbCommand = New OleDbCommand(_SQLQuery, oConn) | |
| Dim oDa As New OleDbDataAdapter(oCmd) | |
| Dim oDS As New DataSet | |
| oDa.Fill(oDS) | |
| DataGrid1.DataSource = oDS.Tables(0) | |
| Label1.Text = oDS.Tables(0).Rows.Count & " Record ditemukan" | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | Public Shared Function _TextAngka(ByVal kode As String, Optional ByVal spasi As Boolean = False) As Boolean | |
| 'ex to use : e.Handled = EtcClass._TextAngka(Asc(e.KeyChar)) | |
| Select Case kode | |
| Case 40 To 57 | |
| Return False | |
| Case 8 | |
| Return False | |
| Case 32 | |
| If spasi Then | |
| Return False | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | Public Shared Sub _HurufBesar(ByVal root As Control) | |
| Dim _Obj As New ArrayList | |
| _Obj.Add(root) | |
| Do Until (_Obj.Count = 0) | |
| Dim Cur As Control = _Obj(0) | |
| _Obj.RemoveAt(0) | |
| For Each _Obj2 As Control In Cur.Controls | |
| _Obj.Add(_Obj2) | |
| Next | |
| Dim _Btn As TextBox = TryCast(Cur, TextBox) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | Public Shared Sub _ExporttoExcel1(ByVal _DataGrid As DataGridView, ByVal _form As Form) | |
| If _DataGrid.Rows.Count > 0 Then | |
| Dim _str As String = _form.Text | |
| Dim _totalExport As Integer = _DataGrid.Rows.Count | |
| Dim _dset As New DataSet | |
| _dset.Tables.Add() | |
| For i = 0 To _DataGrid.ColumnCount - 1 | |
| _dset.Tables(0).Columns.Add(_DataGrid.Columns(i).HeaderText) | |
| Next i | |
| 'tambahkan row | 
NewerOlder