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

B

Brad Isaacs

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
 
B

Brad Isaacs

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top