Solved

Search Results (Win Forms 2.0)

Posted on 2006-07-21
2
194 Views
Last Modified: 2010-04-16

Im building a Search facility and want to return a set of results (Done!)

The results are displayed in a GridView, but I want the user to click a row and then that client info will pop up in the text boxes:

a Sample:

string ConnectionString = "Data Source='db.sdf';";
            SqlCeConnection connection = new SqlCeConnection(ConnectionString);
            connection.Open();
            string strLastName = textBox1.Text;
            string strPostCode = textBox2.Text;
            string strEmail = textBox3.Text;

            if (!(textBox1.Text == null))
            {

                string SelectLastName = "SELECT OID, name, lastname, Postcode, Emailad FROM Eaddress WHERE lastname = '" + strLastName + "'";

                SqlCeDataAdapter da = new SqlCeDataAdapter(SelectLastName, ConnectionString);
                DataSet ds = new DataSet();
                da.Fill(ds, "Eaddress");
                dataGridView1.DataSource = ds;
                dataGridView1.DataMember = "Eaddress";

  }

i have two text boxes called textbox1 and textbox2, when user clicks the row the name appears in textbox and lastname appears in textbox2.

example would help very much!!
0
Comment
Question by:ziwez0
2 Comments
 
LVL 12

Accepted Solution

by:
topdog770 earned 500 total points
Comment Utility
Had response.. then saw the ce part..

Take a look here.. Michael gives a good description of the gridview events you need and a sample of how to use them.

http://msdn.microsoft.com/vcsharp/programming/columns/wonders/default.aspx?pull=/library/en-us/dnforms/html/winforms02172004.asp


0
 
LVL 1

Expert Comment

by:flashaoy
Comment Utility
Look up textbox databinding.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Change to event 1 72
C# Export DataGridView 4 37
visual Basic Net vs c# net 8 53
C# Problem Solving Execerscise 5 39
Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Introduction                                                 Was the var keyword really only brought out to shorten your syntax? Or have the VB language guys got their way in C#? What type of variable is it? All will be revealed.   Also called…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now