Hot to insert both values together?

  • Thread starter Thread starter Miguel Dias Moura
  • Start date Start date
M

Miguel Dias Moura

Hello,

i am inserting some form values in a database. Two of this values are as
follows:

<Parameter Name="@FirstName" Value='<%# IIf(FirstName.SelectedItem.Value <>
"", FirstName.SelectedItem.Value, "") %>' Type="WChar" />
<Parameter Name="@LastName" Value='<%# IIf(LastName.SelectedItem.Value <>
"", LastName.SelectedItem.Value, "") %>' Type="WChar" />

What i want is to insert both FirstName and LastName in the same database
field.

Something like inserting FirstName + " " + LastName in the database field
@FullName.

How can i do this?

Thank You,
Miguel

P.S: using ASP.Net / VB / Microsoft Access
 
Miguel Dias Moura said:
Hello,

i am inserting some form values in a database. Two of this values are
as follows:

<Parameter Name="@FirstName" Value='<%#
IIf(FirstName.SelectedItem.Value <> "", FirstName.SelectedItem.Value,
"") %>' Type="WChar" /> <Parameter Name="@LastName" Value='<%#
IIf(LastName.SelectedItem.Value <> "", LastName.SelectedItem.Value,
"") %>' Type="WChar" />

What i want is to insert both FirstName and LastName in the same
database field.

Something like inserting FirstName + " " + LastName in the database
field @FullName.

How can i do this?

Is this VB.Net code?


--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html
 
Yes, it it is possible.
Or any other way if you think it's better.
 
Armin, it looks like SQL Server parameterised code.
Miguel, you should be able to concatenate using FirstName & " " & LastName
in VB.NET or VBScript.
If you want to concatenate in SQL, use the + notation in your example.
______________________________
The Very Tired Grim Reaper
 

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

Back
Top