473,513 Members | 2,428 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C#, Database Binding to ComboBox

3 New Member
I have bounded a simple database, employee’s last name and first name to a combo box. Now I want the output to show the last name, separated by a comma, followed by first name (Smith, John). The smart tag of the comboBox only allows me to display either the first name or the last name. I tried bunch of setting in ‘add query’ and properties to no avail.

Thank you
Apr 25 '07 #1
4 9092
dip_developer
648 Recognized Expert Contributor
I have bounded a simple database, employee’s last name and first name to a combo box. Now I want the output to show the last name, separated by a comma, followed by first name (Smith, John). The smart tag of the comboBox only allows me to display either the first name or the last name. I tried bunch of setting in ‘add query’ and properties to no avail.

Thank you
have u tried selecting your records like
SELECT lastname+','+firstname FROM Tablename ?????
Apr 25 '07 #2
duke55
3 New Member
It wouldn’t allow me to save the new query. The error message is: “The schema returned by the new query differs from the base query.” Then the only choice is OK and I have to cancel the new query. But your schema works, during the query builder and Execute Query, it shows the right order of names, but it wouldn’t let me save it. Have any other thoughts???

Thanks
Apr 25 '07 #3
duke55
3 New Member
Thanks, dip_developer

It worked, I had to change the properties in ‘edit dataset with designer’ to your scheme and it worked.

Thanks again.
Apr 25 '07 #4
dip_developer
648 Recognized Expert Contributor
Thanks, dip_developer

It worked, I had to change the properties in ‘edit dataset with designer’ to your scheme and it worked.

Thanks again.

you are always welcome....by the way nothing to thanks.....we are here to share our knowledge....
Apr 26 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

9
4741
by: Pam Ammond | last post by:
I need the code to update the database when Save is clicked and a text field has changed. This should be very easy since I used Microsoft's wizards for the OleDBAdapter and OleDBConnection, and...
16
5286
by: Michael C# | last post by:
I'm binding a Combobox to an Arraylist, and I'd like to set the ValueMember and DisplayMember properties of the Combobox. Is this possible, or do I need to bind to a DataTable? Thanks
0
4779
by: JSantora | last post by:
Essentially, InsertAT is broken! For the past couple of hours, I've been getting this "Parameter name: '-2147483550' is not a valid value for 'index'." error. Apparently, its caused by having...
4
23406
by: Jim Shaffer | last post by:
Perhaps I have the wrong construct, or misunderstand arrays in vb (2003).... I've loaded a two-dimensional array (168 by 28) into memory as AcctArray. {Dim AcctArray (500,28) as string...} The...
0
1546
by: oracle | last post by:
Greetings, I have a combo box that I binded to a data set using text and tags. I want it to display the DRT.Name property and have a DRT.UnitId as a value. ...
3
7492
by: Simon Tamman | last post by:
I've come across an interesting bug. I have workarounds but i'd like to know the root of the problem. I've stripped it down into a short file and hope someone might have an idea about what's going...
3
6308
by: =?Utf-8?B?Sm9obiBCdW5keQ==?= | last post by:
New to databinding in vs2005, I always did it manually in 2003. I have no problem loading comboboxes, and a change in that combobox changes the data in the textboxes but I can not figure out a way...
1
9796
by: Monty M. | last post by:
Does anyone know how to perform two way data binding between a combo box and a listview. The listview is bound to a dataset table in code: Binding Bind = new Binding(); DataTable dt;...
5
1582
by: raajakumars | last post by:
urgent!!!!!!! kindly please anyone help me....... actualy i am newbe to vb.net i need data to be inserted in to my table like this... sitenm cdate wrknm nowrk totwg tamiz palace...
2
2010
by: =?Utf-8?B?ZnJlZGR5?= | last post by:
I am new to the whole c# thing, I now how to get data from a db into a combo box. My question is: should I have one table for 5 combo box or have 5 tables for 5 combo box?
0
7260
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
7160
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
7384
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,...
0
7537
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7099
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7525
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4746
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3233
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
799
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.