Click here to Skip to main content
13,090,267 members (79,626 online)
Rate this:
 
Please Sign up or sign in to vote.
See more:
Hi,
How to write the coding for search option.

Regards
Balamurugan
Posted 24-Sep-12 22:55pm
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
bala1989 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?
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

"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).
  Permalink  
v3
Comments
bala1989 25-Sep-12 5:52am
   
when i'm typing my host name and clicking search button it should search the LSTinIPaddress and LSToutIPaddress.
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

control:- 1 textbox, 1 button, 1 datagridview

write code searchbtn_click event

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
:)
  Permalink  
v4
Comments
shambhoo kumar 25-Sep-12 5:16am
   
if this code is helpfull to u then accept my answer...
bala1989 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!
bala1989 25-Sep-12 5:46am
   
when i'm typing my host name and clicking search button it should search the LSTinIPaddress and LSToutIPaddress.
bala1989 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...
bala1989 25-Sep-12 8:39am
   
No one is giving the answer properly... The same result i'm getting for more questions....
Zoltán Zörgő 25-Sep-12 9:03am
   
No one is giving the proper answer, because you do not ask properly :(
bala1989 25-Sep-12 9:08am
   
Don't escape from the question???
Zoltán Zörgő 25-Sep-12 9:12am
   
I don't - even if it is my free choice to do so. Believe me, I would help you, but I still can't see what you want - in technical, programming terms. Please, be aware, that I can not read your mind.
bala1989 25-Sep-12 9:34am
   
Have u got my question???
bala1989 25-Sep-12 9:25am
   
I need coding for search button for C# and for database is sql2005.When i'm typing my computer name in the textbox and clicking the search button it should give the ip address available in my system for LSTinIPaddress and LSTOutIPaddress.
Zoltán Zörgő 25-Sep-12 9:39am
   
So, you have a table in an sql server database on a server. That table contains at least three fields (ComputerName,LSTinIPaddress,LSTOutIPaddress). You have a WindwsForms application that has a form with a field, where you enter a computer name, and you want the two associated IPAddress fields as return. Is this correct? You have a working connection string to the database?
bala1989 26-Sep-12 2:47am
   
Ya u r right....
shambhoo kumar 27-Sep-12 2:08am
   
hello frnd use my code for this purpose........
i think my code is fullfill ur requirement.....
aditiyayuswan 19-Jan-13 12:46pm
   
thanks for you coding this is very helpfully
Shambhoo kumar 19-Jan-13 12:55pm
   
if this code is helpfull to u then accept my answer.

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 |
Web01 | 2.8.170813.1 | Last Updated 19 Jan 2013
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