Click here to Skip to main content
15,881,757 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi,
How to write the coding for search option.

Regards
Balamurugan
Posted
Comments
Zoltán Zörgő 25-Sep-12 4:59am    
It depends.
This is not a well formulated question at all. Nobody will be able to help you, since we have no means to know:
- in what you want to search
- how you want to search
- what you want to search
- what is your platform
- what you want to do with your results
- ...
and several other thigs.
So, please elaborate your question.
Kuthuparakkal 25-Sep-12 4:59am    
explain more, not clear
[no name] 25-Sep-12 5:05am    
I'm using C# for windows form application. when i'm clicking search button it should search the file in the database
Zoltán Zörgő 25-Sep-12 5:26am    
What is "search the file in the database" meaning exactly?

"You should perform a search."

That is both:
  • Have you searched for, yet (I suppose you may find many examples, just Google for)?
  • On button click your program should search for whatever is set in (possibly) another control, inside for instance, a file, or a string (you didn't provide enough details).
 
Share this answer
 
v3
Comments
[no name] 25-Sep-12 5:52am    
when i'm typing my host name and clicking search button it should search the LSTinIPaddress and LSToutIPaddress.
control:- 1 textbox, 1 button, 1 datagridview

write code searchbtn_click event

C#
sqlconnection con=new sqlconnection("Data Source=,; Initial Catalog=database name;uid=sa; pwd=password");
con.open();
da = new sqlDataAdapter("select LSTinIPaddress , LSTOutIPaddress from tablename where computername='" + textbox1.text + "'", con);
                        ds = new DataSet();
                        da.Fill(ds);
                        dataGridView1.DataSource = ds.Tables[0].DefaultView;
con.close();


This is only a sample...plz impliment this code for search file from database...

i think is this possible...

Regard
Sham
:)
 
Share this answer
 
v4
Comments
Shambhoo kumar 25-Sep-12 5:16am    
if this code is helpfull to u then accept my answer...
[no name] 25-Sep-12 5:18am    
It is not helpful:(
Zoltán Zörgő 25-Sep-12 5:25am    
Ask normally to get answers you want!
[no name] 25-Sep-12 5:46am    
when i'm typing my host name and clicking search button it should search the LSTinIPaddress and LSToutIPaddress.
[no name] 25-Sep-12 6:41am    
when i'm typing my host name and clicking search button it should search the LSTinIPaddress and LSToutIPaddress in my system pl any one guide me...

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