473,491 Members | 2,008 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

dropdown list and data source

Hi,

I have a connection to a SQL database. One of the tables in the SQL
Database is DefendentInformation.

I would like to get the firstName and lastName fields from that table
combine them and add that as a value to the drop down list.

However, I don't know what to put in for the datasource property.

Any help would be appreciated
Brian
Nov 21 '05 #1
1 1349
Hi,

Add a new calculated column to your dataset. Use that column as the
displaymember in the dropdownlist.

Dim dc As DataColumn

'

' Add a new column in clients table which

' is full name.

dc = New DataColumn("Name")

dc.DataType = System.Type.GetType("System.String")

dc.Expression = "LastName + ', ' + FirstName"

dsClient.Tables(0).Columns.Add(dc)

Ken

--------------------
"bbdobuddy" <bb*******@discussions.microsoft.com> wrote in message
news:E0**********************************@microsof t.com...
Hi,

I have a connection to a SQL database. One of the tables in the SQL
Database is DefendentInformation.

I would like to get the firstName and lastName fields from that table
combine them and add that as a value to the drop down list.

However, I don't know what to put in for the datasource property.

Any help would be appreciated
Brian
Nov 21 '05 #2

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

Similar topics

3
7063
by: Charles | last post by:
I am trying to add the ability for a user to change the order in which the elements are listed in a dropdown list box. Before I added the ListID field the dropdown list box order was controlled...
5
3332
by: david | last post by:
I have a question in the following. Any one could give me a help? Thanks David The dataset is declared and created at Class level. My source code is here: Private Sub...
2
2833
by: Peter | last post by:
ASP.NET 2003 In the DataGrid how do I select current cell value in the dropdown box when I click on the edit link, currently when I click on the edit link in the DataGrid the dropdown box...
0
929
by: Mike C | last post by:
I've been grappling with this for days and hope someone has some suggestions. I have a datagrid that I'd like to place entirely in edit mode so people don't have to update data row by row. I've...
0
1386
by: Chicagoboy27 | last post by:
I am wondering how to set an object datsource or any data source for a dropdown list that is a details view. Here is a brief set up. I have a details view that lists a bunch of information. when a...
0
1335
by: Kay | last post by:
Hello, I have written my own custom control and I want one of its properties to display as a dropdown list when clicked, so the user can select from the list, it would be similar to the asp...
0
1597
by: Kay O'Keeffe | last post by:
Hello, I have written my own custom control and I want one of its properties to display as a dropdown list when clicked, so the user can select from the list, it would be similar to the asp...
6
5835
by: yasodhai | last post by:
Hi, I used a dropdown control which is binded to a datagrid control. I passed the values to the dropdownlist from the database using a function as follows in the aspx itself. <asp:DropDownList...
5
27354
by: =?Utf-8?B?QnJlbmRlbiBCaXhsZXI=?= | last post by:
Hello. I am reading a value from a table and trying to determine if that value exists in a list of values associated with a dropdownlist. If so, I select the value, otherwise, I don't. I haven't...
5
10321
by: =?Utf-8?B?Y2hlY2tyYWlzZXJAY29tbXVuaXR5Lm5vc3BhbQ== | last post by:
I have a VS 2008 ASP.NET webform that has a reportview tag on it, accessing an .RLDC report in local report. The columns for the report are essentially: Month Item #1 Item#2 Item#3 ...
0
7115
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
7154
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
7190
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
6858
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
7360
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...
1
4881
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3086
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...
0
1392
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
633
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.