Click here to Skip to main content
13,003,388 members (58,091 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hii,everybody i'm beginner

How to make button for search data in database access in windows form,i'm trying but faliure to do.
Posted 19-Sep-12 1:00am
Wes Aday 19-Sep-12 7:05am
You drag a button from the toolbox and drop it on your form in the form designer.
Manfred R. Bihy 19-Sep-12 7:06am
You'll have to explain more where exactly your difficulties are. We can't see your screen and neither do we have access to your disk.
Please add more details like some code snippets, error messages if applicable. "I'm trying, but failure to do" is not a helpful description of your woes.
CodeHawkz 19-Sep-12 8:04am
@Professionals above this comment: Don't pick on the poor fellow :D Point him in the right direction would you? I bet any of you can write few steps for him to get the basic idea :)

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Hi there,

You cannot 'make' the button do anything :D

Drag and drop a button on to your form. Double click on it. In the auto generated method, write code to open a connection to your database. Write a SELECT sql statement in which the WHERE clause will contain the criteria you want to search from. Execute that SQL and display it in a datagrid or something.

Sample SQL: SELECT * FROM [MyTable] MT WHERE MT.Name LIKE '%hawkz%'
This SQL will pull all rows of 'MyTable' where 'Name' column contains the string 'hawkz'

Try following these steps and implementing it. It won't be easy for you I guess. But try and post some code that gives an exception or does not work as you hope. Then we'd try and help you figure out where the problem is.

Hope this help you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170626.1 | Last Updated 19 Sep 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100