Skip to main content

Posts

Showing posts from 2014

How To Handling Quote (') In VB.Net

hi there here i will share the way to handle quote (') during coding with VB.Net sometimes we will have data such as (MAT'L) that quote is definitely forbidden when we are use the data. create a function as below : Public Function Ganti(ByVal Kata As String) As String         Ganti = Replace(Kata, "'", "''")     End Function and here is this how you gonna use that function, read carefully Public Sub InsertDataDefect(ByVal Row As Integer)         Dim DefectName As String = dgvInputBMISDetail.Rows(Row).Cells("dgvInputBMISDetailDefectName").Value.ToString         Koneksi()         cmd = New SqlCommand("SELECT * FROM dbo.mstDEFECT WHERE (ActiveTo IS NULL) AND DefectName='" & Ganti(DefectName) & "'", Conn)         rd = cmd.ExecuteReader         rd.Read()         If rd.HasRows Then             With dgvInputBMISDetail                 .Rows(Row).Cells("dgvInputBMISDetailRecNoDefect").Value

How To Check Picture In Database

 Private Sub CARI_FOTO()         MyConnection.TUTUPKONEKSI()         cmd = New SqlCommand("Select Photo, AutoRecordNoStamp From mstSTAMP " & _                             "Where AutoRecordNoStamp='" & LblAutoStampNo.Text & "'", MyConnection.BUKAKONEKSI)         DTR = cmd.ExecuteReader         DTR.Read()         'Cek kalo2 data gambar ada ato gak didalam database 01.12.2014         If DTR("Photo").ToString <> "" Then             Dim Gambar As New IO.MemoryStream _             (CType(DgvSTAMP.Item(7, DgvSTAMP.CurrentRow.Index).Value, Byte()))             ImgFOTO.SizeMode = PictureBoxSizeMode.StretchImage             ImgFOTO.Image = Image.FromStream(Gambar)         Else             ImgFOTO.Image = Nothing         End If     End Sub

How To Check If Cell Value In Datagridview Is Null Or Empty

Here is this another thing that i try to solve in doing a project with VB.Net. Scheme : i want my application to load data from datagridview to textbox or combobox but the trouble is datagridview cannot load data from an empty/null cell column.   Private Sub DgvSTAMP_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DgvSTAMP.CellContentClick        'Cek bila nilai pada cell di datagridview ada yang kosong         For F As Integer = 0 To DgvSTAMP.RowCount - 1             If IsDBNull(DgvSTAMP.CurrentRow.Cells(1).Value) Then                 TxtSTAMPNO.Text = ""             Else                 TxtSTAMPNO.Text = DgvSTAMP.Item(1, DgvSTAMP.CurrentRow.Index).Value             End If             If IsDBNull(DgvSTAMP.CurrentRow.Cells(2).Value) Then                 TxtINSPECTORNAME.Text = ""             Else                 TxtINSPECTORNAME.Text = DgvSTAMP.Item(2, DgvSTAMP.CurrentRow.Index)

How To Load Month And Year In ComboBox Using VB.Net

create 2 ComboBox 1. CmbBulan 2. CmbTahun Private Sub Isi_Combo_Pencarian()         With CmbBulan             Dim Angka As Integer             .DataSource = Nothing             .Items.Clear()             For i = 0 To 11                 Angka = i + 1                 .Items.Add(Angka)             Next         End With         With CmbTahun             Dim P As Integer = Year(Now) - 5             Dim A As Integer = Year(Now)             .DataSource = Nothing             .Items.Clear()             For i = P To A                 .Items.Add(i)             Next         End With     End Sub

How To Delete File In A Folder Using VB.Net

Imports System.IO  Private Sub DeleteFileInFolder()         Dim PathFile As String = Application.StartupPath & "\PengaturanTechnical\" & LblNomorLTSeksi.Text & ".pdf"         If System.IO.File.Exists(PathFile) = True Then             System.IO.File.Delete(PathFile)             MsgBox("File Has Been Deleted Completely")         Else             MsgBox("File Does Not Exist")         End If     End Sub

How To Check If Datagridview Is Empty In VB.Net

How To Use Enter (Keyascii 13) In ComboBox

How To Use Uppercase In ComboBox VB.Net

Crystal Report In MS. Visual Studio 2010 With VB.Net

Upgrading knowledge is what making an IT different then the other one. But sometimes it would takes a difficulties, trouble and problem when migrating our knowledge caused of our own knowledge limitation. In this article we will talking about knowledge migration from VB2008 to VB2010, and we make specified to reporting what we called CR (Crystal Report). For you who don’t know that CR is no more longer included in visual studio 2010, so from now you have to believe by proved it by your self by installing VB2010 correctly, i’m sure you will surprised that you cannot find ReportViewer inside. Download File

How To Loop Multiple Looping In DatagridView VS2008

This is another one of my article in 2014. this article i made and share after i have a project at the place where i am working.. the system need to calculate automatically before input into database, this step needs only for a random checking before inputting data. for couple days i get confused but finally i get this to solve brightly.. just share one of my experiences about coding in VS2008. have a nice study guys.. File To Download

Binding Excel Data Into ListView or DatagridView Using VB.Net 2008

Hi, there this is my first article in 2014. anyway you might be having trouble to finding a source code to binding excel data into ListView or DataGridView in VB 2008. some people sure will having project as i do with this code. so i will share my experience about it. to make it simple you can directly download below file. Download File