Click here to Skip to main content
15,915,772 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
how to merge int no and string for making new ID????
example:-CO101,RE201
how to write in query????
Posted
Comments
Sergey Alexandrovich Kryukov 5-Jun-12 1:35am    
"Merge"?!
--SA

Since your question in marked as ASP.NET, I am assuming you want this in the code so here is the example

C#
int num = 101;
string s = "cs"

string result = String.Format("{0}{1}",s, num);

//here result becomes "CS101"; 
 
Share this answer
 
Dircet U cann't merge int value into string, if you want this you can convert string into int value using Convert.Int32(string string) ; method.

Thank u
 
Share this answer
 
please look this simple example

SQL
declare @id int set @id=101
declare @strid varchar(10) set @strid='CO'

select @strid + cast(@id as varchar(10)) as NewId

it will work.if it work accept as answer.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900