Hello! first of all i'm a newbie **and don't know much about visual basics.
I'm using **Visual Basics 2008
and i'm having a problem. It is that i don't know how to generate a search through my 'cmdsearch' i browse on internet but got nothing that approach to my expectations. Briefly i want to have a search command which will search for example 'Employee_ID or Surname' but i don't know how to proceed :(
so my program is just looking like that.Please help me!
Private sub cmdSearch_Click(By Val sender as system.Object, ByVal e As System.eVventArgs)

End sub

ok here is a example , you can search your all emplyees by there names , do something like this first take a form with a grid and a textbox , now use this code at the textbox text change event.

dim con as new sqlconnection("your connection string")
con.open()
dim da as new sqldataadapter("select EmpName from emloyees where empName like '%" & textbox1.text & "%'" ,con)
dim dt as new datatable
da.fill(dt)
datagridview1.datasource = dt
con.close()

it will work fine :P Hope it will help you . if your prob will solved then please mark this thread solved.

Regards

Thank you a lot!but i think that i am too dumb to carry on. :(
Everything that i'm taking is a failure..
Regards.

@K.os, can you please tell us what are you using?are you using MS Access as your database?
or just a file?...and then after searching where do you want to display this in MS flexgrid?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.