473,379 Members | 1,170 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Hot to insert both values together?

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
Nov 20 '05 #1
4 889
"Miguel Dias Moura" <we****@27NOSPAMlamps.com> schrieb
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

Nov 20 '05 #2
Yes, it it is possible.
Or any other way if you think it's better.

"Armin Zingler" <az*******@freenet.de> wrote in message
news:40***********************@news.freenet.de...
"Miguel Dias Moura" <we****@27NOSPAMlamps.com> schrieb
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

Nov 20 '05 #3
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

"Armin Zingler" <az*******@freenet.de> wrote in message
news:40***********************@news.freenet.de...
"Miguel Dias Moura" <we****@27NOSPAMlamps.com> schrieb
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

Nov 20 '05 #4
"Miguel Dias Moura" <we****@27NOSPAMlamps.com> schrieb
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?


Yes, it it is possible.
Or any other way if you think it's better.


Sorry, I don't understand you.

--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html
Nov 20 '05 #5

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

Similar topics

3
by: jason | last post by:
How does one loop through the contents of a form complicated by dynamic construction of checkboxes which are assigned a 'model' and 'listingID' to the NAME field on the fly in this syntax:...
0
by: Frank Maestas | last post by:
Hello, I database table that I need to add checkbox data (using an array) and standar fields. My standard fields insert just fine, as does my array when trying them alone. Together - doesn't...
16
by: Philip Boonzaaier | last post by:
I want to be able to generate SQL statements that will go through a list of data, effectively row by row, enquire on the database if this exists in the selected table- If it exists, then the colums...
6
by: Maurizio Faini | last post by:
I have a little problem. there is a way to get last id inserted into db or i have to make a new query? I explain better my question: in vbscript using sqlserver2000 i can use this code: ...
3
by: Sagi | last post by:
if i use the insert to add a new row to the access database, something like: INSERT INTO tblCat (CatName,CatOrder,StoreID) VALUES( '" & strNewCat&"', "& strMaxiO& ", 1); and there is another...
10
by: Ricardo | last post by:
How can I make a insert sql string to insert direct in a table(not a dataset) using the textbox.text propert??
4
by: Mike Hnatt | last post by:
My goal is to get data from an XML file into a couple of tables in an Access database. The XML file is a little complex so I need control over what I do (I can't just read it into a dataset). ...
1
by: Sockpuppet | last post by:
After having googles I've knocked together ther following code. What I am trying to do is select all items in one table and move through them adding them into other tables (splitting them and...
1
by: ssims | last post by:
I'm working with ASP.Net on IIS 5.1 and MSSQL 2000 and have a rather frustrating problem. I'm trying to insert a record to a table, get the identity value, and insert two additional records to a...
4
bugboy
by: bugboy | last post by:
I'm inserting a new word into table 'w' and a definition into table 'c' which are linked in table 's' which is the relation table for the many to many relationship between 'w' and 'c'. I've been...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.