Filter datatable with Like

I am traying to filter Datagrid view based on user type in TbxGlCode (TextBox)

Initialy Datatable is populated from SQL table to TempTable (DataTable)

getting error at runtime at below line

Dim Rows As DataRow() = TempTable.[Select]("Code like '%" & VerCode & "%'")

Exception Unhandled
System.Data.EvaluateException: 'Cannot perform 'Like' operation on System.Int32 and System.String

How to filter datatable with Like option

My Code

Dim TempTable As DataTable

    Private Sub FrmGLCodeList_Load(sender As Object, e As EventArgs) Handles MyBase.Load

        ' Dim TempTable As DataTable
        'Create New Table Instance
        TempTable = New DataTable

        TempTable.Columns.Add("Code", GetType(Integer))
        TempTable.Columns.Add("Name", GetType(String))

        'Adding Rows to TempTable from SQL table

        Call RSData("Select GlCode as Code , GlName as Name from TblGlCodeMaster")

        Dim I As Integer = 0

        If DBCnCommonDataTable.Rows.Count > 0 Then
            For I = 0 To DBCnCommonDataTable.Rows.Count - 1
                TempTable.Rows.Add(Trim(DBCnCommonDataTable.Rows(I)("Code")), Trim(DBCnCommonDataTable.Rows(I)("Name")))
            Next
        End If

        DgvGlCodeView.DataSource = TempTable

        DBCnClose()
        DgvGlCodeView.Columns(1).Width = 300
    End Sub
    'Filtered data table
    Private Sub FilteredDT()

        Dim VerCode As Integer = Trim(TbxGlCode.Text)
        Dim FilteredDT As DataTable = TempTable.Clone
        Dim Rows As DataRow() = TempTable.[Select]("Code like '%" & VerCode & "%'")
        For Each row As DataRow In Rows
            FilteredDT.ImportRow(row)
        Next

        DgvGlCodeView.DataSource = FilteredDT

    End Sub

    Private Sub TbxGlCode_TextChanged(sender As Object, e As EventArgs) Handles TbxGlCode.TextChanged

        Call FilteredDT()
    End Sub

The Ultimate Webmaster Malaysia

We are a web design company in Malaysia specializing in building website for SMEs and other businesses. We also provide SEO services and video marketing. All of our packages are backed by an iron-clad money back guarantee so you can have peace of mind while working with us. We have built website for small private companies all the way to multinational companies.

The post The Ultimate Webmaster Malaysia appeared first on WeLoveWP.

SimplySearch

SimplySearch Marketing is a full service digital marketing agency based in Orlando, Fl. We’ve been servicing our clients since 2012 and have generate over 20,000 leads to date for our clients.

The post SimplySearch appeared first on WeLoveWP.

Multiple Toggle in the same window

So I'm trying to create a UI that allows multiple buttons in the same window. All of the are toggles to control GPIO outputs to control relays. I've managed to get them to all work individually in their own files, but when put into the same file is all on or all off. There is only 4 toggles for now, as a demonstration for my boss, but there will be many more on the final product.`

Below is the code I've come up with so far. (keep in mind I only started learning Python and coding in general yesterday) I'm on a bit of a time crunch and have used the search function. Thats the only way I've gotten this far. Thanks in Advance!!

import RPi.GPIO as GPIO

GPIO.setmode(GPIO.BCM)

GPIO.setwarnings(False)

try:
import Tkinter as tk
except ImportError:
import tkinter as tk

from Tkinter import *

win=Tk()
win.title("Q")

def toggle():
    if b1.config('text')[-1] == 'AMBIENT':
    b1.config(text='OFF')
    GPIO.setup(24, GPIO.OUT)
    GPIO.output(24, GPIO.LOW)

else:
    b1.config(text='AMBIENT')
    GPIO.output(24, GPIO.HIGH)

if b2.config('text')[-1] == 'CEILING':
    b2.config(text='OFF')
    GPIO.setup(18, GPIO.OUT)
    GPIO.output(18, GPIO.LOW)

else:
    b2.config(text='CEILING')
    GPIO.output(18, GPIO.HIGH)

b1 = Button(win, text="AMBIENT", command=toggle)
b2 = Button(win, text="CEILING", command=toggle)
b3 = Button(win, text="LASER", command=toggle)
b4 = Button(win, text="RADIO", command=toggle)

b1.pack(pady=2)
b2.pack(pady=2)
b3.pack(pady=2)
b4.pack(pady=2)

mainloop()

Building Plugin Stacks for Complex WordPress Sites

With the right plugin stack, WordPress can produce some powerful and complex sites. But WordPress has no central authority coordinating everyone’s efforts, so plugin incompatibilities are a big problem. That’s like, the textbook definition of complexity: Complexity characterises the behaviour of a system or model whose components interact in multiple ways and follow local rules, meaning there is […]