Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

database search

Status
Not open for further replies.

venuchalla

Programmer
May 30, 2006
29
FR
Hello,
I am having three tables in the same database, these three tables have column of type varchar(max).
Now In my web page i have a text box and a search button .

When the user enters a string in the textbox and clicks that search button, then the three tables have to be searched for that purticular string and the results have to be shown in a grid view.

Please help me how I can do this, I have searched the internet a lot but I could not figure out what to do..

Help please...
 
NO,

Table -- Issues -- columns -- Description varchar(max)

and table - scheduledevents - columns - information varchar(max)
 
I am able to do the webpages search , but I want to do the database search and show the results in a gridview.

Help please
 
if all tables have same number of fields use a UNION ALL query. then bring the results into a grid.

 
Hello,
I am trying with one table first to see if it works.
This is how i have written the select statement in the application and binding the dataset to the datagrid.


"SELECT IssueNumber , Issues.Description AS Description FROM Issues WHERE Issues.Description LIKE '"+ TextBox1.Text+"'"

there is a text box in which i enter the string and on click of the search button i get the results of the query in the grid.

Now if i have a record like

1 tests verified--- record 1
2 aaa -- record 2

now if i give string in textbox as "aaa" the grid gets data with only that string, but if i give "tests" as the string i dont get any records in the grid.

How to do a search on the strings like that.

please help
 
Yes, I could do that now.Thankyou.

I want to put a new details column which should be a hyperlink to the record details.
How can I do that because I am searching the text from 3 tables like this...

string strSQLQuery = "SELECT Issues.Description AS Description FROM Issues WHERE Issues.Description LIKE '%"+ TextBox1.Text+"%'"
+ "UNION "
+ "SELECT ScheduledEvents.Information AS Description FROM ScheduledEvents "
+ "WHERE ScheduledEvents.Information LIKE '%" + TextBox1.Text + "%'"
+ "UNION "
+ "SELECT TSGUpdate.Property AS Description FROM TSGUpdate "
+ "WHERE TSGUpdate.Property LIKE '%" + TextBox1.Text + "%'";

How to put a details hyper link to go to the details of that purticular record selected???
Help!!

 
after your query runs and the grid rebinds, you should be able to make the link's dataitem = Description. since you running a UNION, it should be able to populate that dataitem correctly.

 
when i did dataitem = details, i get the same description which is already on the grid again displayed on the page in the links column.

I want to go to a different details page when I click on the details link..

How do I do that..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top