473,387 Members | 1,611 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

2 text box for search in connected mode

a
Dear friends I have this code but not work

What I want

I want to design search form to search by (customerid and customername)

This is the code that I want you repair it for me

My problem is:

I can search using one text box on the form

I need to search using 2 text box

I want you imagine what I want

I have a form with some text box

And 2 text box for search

And one button called search

I want if the user type a value in one of text box the search work if he
type 2 value in 2 text box the search work

Its easy but I don't know the information reach to you or not



Dim cn As New OleDbConnection

cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\Documents and Settings\az\Desktop\A1.mdb;Persist Security
Info=False"

cn.Open()



Dim cmd As New OleDbCommand

cmd.CommandText = "Select * from t1 where CustomerId=?,
customername=?"

cmd.Connection = cn

Dim pr As New OleDbParameter

pr.Value = txtsearchCustomerId.Text

cmd.Parameters.Add(pr)

Dim pr1 As New OleDbParameter

pr1.Value = txtsearchcustomername.Text

cmd.Parameters.Add(pr1)

Dim dr As OleDbDataReader

dr = cmd.ExecuteReader



dr.Read()

If dr.HasRows Then

txtCustomerId.Text = dr(0)

TxtCustomerName.Text = dr(1)

End If

cn.Close()

cmd.Dispose()

dr.Close()

End Sub


Jul 7 '08 #1
0 789

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Craig Stadler | last post by:
I am looking for information on the proper way to code full text queries and more information on how they work. I am especially interested in how to code for multi word queries... for example :...
6
by: Andrew Thompson | last post by:
Is there a way to achieve (or a good reason not to) the 'vertical text' effect displayed here in the planetary labels.. http://www.physci.org/test/graph/imgresize.html The page uses <br> to...
2
by: alyssa | last post by:
May i know hot to implement the code when the user enter their customer ID in a text box and a report based on the customer ID will be shown? I have done the data binding in the text box....and I...
2
by: Zeya | last post by:
I have an application where I am required to run a full text query. My database is MySQL and code in C#. The way all queries are SELECT * FROM table WHERE firstname = ? and using command...
12
by: Charlie King | last post by:
As I understand it, the use of FIR* to replace heading tags with images in visually enabled CSS browsers is now frowned upon on the basis that some screen readers will *nor* read back text that is...
63
by: John Salerno | last post by:
I know there's a request for a good IDE at least once a week on the ng, but hopefully this question is a little different. I'm looking for suggestions for a good cross-platform text editor (which...
2
by: Gabriel | last post by:
Hello, I'm looking for documentation with "Best Practice" for ASP.NET application In which case use Connected or Disconnected mode Typed dataset or not ? I didn'd find anything pertinent...
2
by: a | last post by:
Dear friends I want to use 2 text box on the form to search data in connected mode I'm use this code and this code not work Please see the sql because may be wrong Thank you
2
by: TG | last post by:
Hi! I am trying to export only the visible columns from a datagridview in my windows form in VB 2008. Should't it be no comma after the first row where the headers are? Also should...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.