query in searching

srivalli

Well-known member
Joined
May 4, 2005
Messages
189
Programming Experience
Beginner
in my form i enter some queries for a particular bank.

for each bank ,i enter nearly 10 queries in ten different textboxes.

so, what i did is , each query i am entering in a textbox and i am storing it in one column at the back end. (say the column name is qry1 in msaccess)

so there are 10 queries in vb.net ,and there are 10 columns in the back end

now my query is :

now in vb.net, when i enter some word in a textbox and when i click button, i want to display all the queries related to that word, irrespective of the bank.

suppose if the word "tax" is there in 2 different banks,then i want to display all the queries related to "tax"

hope my question is very clear.

let me know as early as possible.


thanks
 
one more prblm while testing.

one more problem has occured while testing the code.
that is
for the first bank,
in textbox1 i entered some data with keyword "income".

when i test the code it is working fine.

next for the second time that is for the second bank,
if i enter the data with keyword "income" in some other textbox, say in textbox2,
then when i run the application,both the columns should be displayed.

instead it is displaying "income " in only textbox1,but not in textbox2.
is there any solution to display both the columns which contains "income"

thank u
 
displaying in grid rather than textboxes

instead of displaying the result in textboxes,if i want to display in datagrid.

then do i need to bind the value each time.i mean for each query
any hints plllls
veryyyyy veryyyyyyy urgent.
 
displaying columns (veryyyyyyyyyyyyyyyyy urgent)

for displaying a single column which matches the keyword in both textbox and listview ,the below code is working perfectly

but for displaying more than one column which matches the given keyword in textbox , i wrote the code as follows:


Dim selectsql As String = String.Format("select * from investor where mqry1 like '%{0}%' or mqry2 like '%{0}%' or mqry3 like '%{0}%'", Me.TextBox1.Text.Trim())

' textbox1 in which i am entering the keyword.

Dim da As New OleDbDataAdapter(selectsql, cn)
Dim table As New DataTable("investor")
da.Fill(table)
Dim therow As DataRow = table.Rows(0)

'mqry1 ,mqry2,mqry3 are the columns in which the search is done.

If CStr(therow("mqry1")).IndexOf(Me.TextBox1.Text.Trim()) = -1 Then
Me.TextBox2.Clear()
Else
Me.TextBox2.Text = CStr(therow("mqry1"))
End If

If CStr(therow("mqry2")).IndexOf(Me.TextBox1.Text.Trim()) = -1 Then
Me.TextBox3.Clear()
Else
Me.TextBox3.Text = CStr(therow("mqry2"))
End If

If CStr(therow("mqry3")).IndexOf(Me.TextBox1.Text.Trim()) = -1 Then
Me.TextBox4.Clear()
Else
Me.TextBox4.Text = CStr(therow("mqry3"))
End If

but the problem with the above code is

if i give any keyword in textbox1 and when i click the button,
only first matching column is displayed,even though there are more than one columns,the next columns are not checked.


for displaying the matched keyword column in listview ,i wrote the code as

Dim item As ListViewItem
For Each row As DataRow In table.Rows
item = New ListViewItem

If CStr(row("mqry1")).IndexOf(Me.TextBox1.Text.Trim()) = -1 Then
item.Text = String.Empty
Else
item.Text = CStr(row("mqry1"))
End If

If CStr(row("mqry2")).IndexOf(Me.TextBox1.Text.Trim()) = -1 Then
item.SubItems.Add(String.Empty)
Else
item.Text = CStr(row("mqry2"))
End If

If CStr(row("mqry3")).IndexOf(Me.TextBox1.Text.Trim()) = -1 Then
item.SubItems.Add(String.Empty)
Else
item.Text = CStr(row("mqry3"))
End If

Next
Me.ListView1.Items.Add(item)

if i use the above code ,
the keyword is being searched and the last matching column is displayed in the listview and the first matching columns are ignored.

if i use both the textbox and listview simultaneously
in textbox, first matched column is displayed.
and in listview, the last matching column is displayed.

so what do i do to dispaly the columns in between which matches the keyword.
any suggestions.
welcome.

can anyone tell me where the error is ? or what are the modifications required?
its veryyyyyyyyyyyyyyyy urgent.
thank u
 
searching in asp.net

can i write the above code in asp.net .

if yes, what modifications can be done to the code.
thank u
 
developing a project in asp.net

i developed a small project in asp.net.
i deployed it .now i want to keep that project in NET.
then what should i do
any suggestions
thank u
 
Back
Top