Click here to Skip to main content
15,895,746 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
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
Comments
[no name] 19-Sep-12 7:05am    
You drag a button from the toolbox and drop it on your form in the form designer.
Manfred Rudolf 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.
[no name] 19-Sep-12 7:28am    
mhassan083639 wrote:
I am beginner.

Yes You are. It is known by the way you are asking.
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

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.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900