473,503 Members | 1,803 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DropDownList box ~ Update Concatenated fields ~Help Please???

Using ASP.NET 2.0 with SQL Server 2000

Inside my dropdown list box I am using an SQL DataSource to select the
following data

SELECT RTRIM(c.Name_First) + ' ' + RTRIM(c.Name_Last) AS Contact,
c.phone As PriPortPhone
FROM mppaContacts c

Dropdown list box works well .....

Now I am trying to UPDATE the table name mppaContacts with what the user
selects from the drop down list box.

How do I UPDATE the table when the names are concatenated?
I need to select a substring for the Name_First field then for the Name_Last
field but I am unsure how to perform this.........any ideas?

UPDATE mppaContacts
SET
[Name_First] = @FirstName
[Name_last] = @LastName
[phone] = @phone
Any ideas would be greatly appreciated........not sure how to extract the
individual names and place them into their specific fields.
Thanks in advance

~Brad
------------------------------
Brad Isaacs

Mar 7 '07 #1
1 2354
DropDownList ID = ddlPriPortContact

'Split the strings into 2 halves

Dim P As Integer = ddlPriPortContact.Text.IndexOf(" "c)

Dim FirstName As String = ddlPriPortContact.Text.Substring(0, P)

Dim LastName As String = ddlPriPortContact.Text.Substring(P + 1)

Issue resolved................ thanks anyhow,

~B-RAD!


"Brad Isaacs" <bi*****@rogers.comwrote in message
news:ei**************@TK2MSFTNGP03.phx.gbl...
Using ASP.NET 2.0 with SQL Server 2000

Inside my dropdown list box I am using an SQL DataSource to select the
following data

SELECT RTRIM(c.Name_First) + ' ' + RTRIM(c.Name_Last) AS Contact,
c.phone As PriPortPhone
FROM mppaContacts c

Dropdown list box works well .....

Now I am trying to UPDATE the table name mppaContacts with what the user
selects from the drop down list box.

How do I UPDATE the table when the names are concatenated?
I need to select a substring for the Name_First field then for the
Name_Last field but I am unsure how to perform this.........any ideas?

UPDATE mppaContacts
SET
[Name_First] = @FirstName
[Name_last] = @LastName
[phone] = @phone
Any ideas would be greatly appreciated........not sure how to extract the
individual names and place them into their specific fields.
Thanks in advance

~Brad
------------------------------
Brad Isaacs

Mar 8 '07 #2

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

Similar topics

2
2369
by: B Love | last post by:
Hello Group, I have 2 text fields that I would like to concatenate for use in a table. One field is an ordinary text box. The other is a simple combo box which I use to select one of about ten...
2
1994
by: jason | last post by:
Pardon my ignorance on this. The below code works, except, when I edit a record and update the two drop downs take the first entry in the dropdownlist if not selected. I'd also like the dropdown to...
1
2589
by: Jeff | last post by:
Hi - I'm creating a web control library (using VB.NET), and I'm trying to add a modified asp:dropdownlist control to it. How do I add asp:ListItems to the dropdownlist (within the web control...
4
1724
by: glenn | last post by:
Hi folks, I am getting an error "Object reference not set to an instance of an object". It seems I have everything in place but something is obviously in err. If you could take a quick peak...
1
7752
by: mitchman10 | last post by:
My Time table has TimeID,Employee,PayPeriod,ChargeCodeID,Hours My Chargecode table has ChargecodeID,c_Text I need an Editable datagrid that will show the TimeID,Employee,PayPeriod,C_Text in a...
2
1777
by: teddymeu | last post by:
Hi Guys, this is kinda complicated but ill do my best to explain. I have two tables. products and categories. Products holds product info and an image, its primary key is ProductID. Category table...
3
2715
by: gsauns | last post by:
Hello, I have an ASP.NET app with a DropDownList on the page, which is bound to values from a table. I have a Repeater control on the page whose displayed data is dependent on the DropDownList...
0
1457
by: Dan | last post by:
Hi, I have a detailsview with two fields: in editmode, one is a textbox and the other is a dropdownlist. i want to update both fields using the detailsview. My problem: when clicking on the...
3
1683
by: EdisonCPP | last post by:
Hi, I have a DetailsView with a template field with a dropdownlist added to it. If the data coming into that field were put into a textbox, it would look like: Small|Medium|Large|X-Large. I...
0
7202
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
7086
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...
1
6991
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
7460
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
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5014
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
3167
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
1512
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
736
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.