954,515 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Problem with Search code in Visual Studio 2005

HELLO EVERY1,
Im having difficulties in Visual Studio 2005 where I have a search program to search students from a database.It works fine but i donot get similiar records in the grid like there can be many people with same first name or last name
E.g. If i select a first name radio button and enter a specific name like "Mary" it should display all mary`s present in that database.
Same applies for last name.
CAN U PLZ HELP IMMEDIATELY as this is a part of my project.

shivangiKul
Newbie Poster
1 post since Apr 2008
Reputation Points: 10
Solved Threads: 0
 

Posting the code you have so far will help us find where your problem is.

toko
Junior Poster
104 posts since Aug 2007
Reputation Points: 10
Solved Threads: 8
 

Use "Like" operand in your Select query.
eg : Select * from Author where Id Like "1234"

Jx_Man
Nearly a Senior Poster
3,329 posts since Nov 2007
Reputation Points: 1,372
Solved Threads: 444
 

Sounds like the query is using DISTINCT.

Depending on the database engine it may be better to use the GROUP BY?

When using a DISTINCT in the database query, it will not repeat rows with the same data. (IE. If you have 7 rows with the first name 'Mary' and you using a SELECT DISTINCT, even if the last name differs, only the one row will show.)

danielgee
Newbie Poster
15 posts since May 2008
Reputation Points: 10
Solved Threads: 2
 

Hi Sir,

I'm using drop down list to get country names from Database(SQL SERVER)..Now th epblm is i'v to hv the "Select Country" as the default one for Drop Down list.Help me in this.Thank you

Jahira
Newbie Poster
17 posts since May 2008
Reputation Points: 10
Solved Threads: 0
 

Hi Sir,

I'm using drop down list to get country names from Database(SQL SERVER)..Now th epblm is i'v to hv the "Select Country" as the default one for Drop Down list.Help me in this.Thank you


do not hijack other thread, please make your own thread...

Jx_Man
Nearly a Senior Poster
3,329 posts since Nov 2007
Reputation Points: 1,372
Solved Threads: 444
 

After your datafill eg: Me.TestTableTableAdapter.Fill(Me.DataSet1.TestTable) - VB will generate this for you

use:
ComboBox1.Text = "Select Country"

danielgee
Newbie Poster
15 posts since May 2008
Reputation Points: 10
Solved Threads: 2
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You