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
 
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
 
Back
Top