Write this code in second Form
label1.Text = Application.OpenForms["FirstForm"].Controls["controlname"].Text;
Write this code in second Form
label1.Text = Application.OpenForms["FirstForm"].Controls["controlname"].Text;
How to replace spaces in text stored in sql server with in function or Store Proceduer?
declare @name as varchar(50)
declare @rep as varchar
set @rep=’ ‘
set @name=’kamal raja v’
select replace(@name,@rep,”)
It will replaces the characters what ever you define in @rep that character is replaced from @name.
It is help full when writing functions or stored procedures , bcoz sql does not provides directly Trim() function which replaces spaces between given text.
select getdate() —– > To get Current Date
select datepart(day,getdate()) —–> To get Day
select datepart(month,getdate()) —-> To get Current Month
select datepart(year,getdate()) —-> To get Current Year
Some examples of converting date format:
select convert(varchar,getdate(),111) =====> ‘2008/5/21′
select convert(varchar,getdate(),106) =====> ‘21 May 2008′