Hi
I'm doing my project in asp.net using C# and sql server 2008.
when i display the information in grid view by default it show the time value as 04/19/2014 12:00:00 AM how to change it to current system time, Or i no need to display the time in that grid view. please help me.
My Table created format is
create table sigup(id int, name varchar(20), date date, address varchar(50));
pls share the solution in for this
my mail id [email protected]
thank you
karthigeyan.S
Loading

Ranjit PowarPosted Mar 24, 2014, 6:08 AM
Convert date in select query as follows
convert(varchar,Column name,101) As Column name
Jignesh TrivediPosted Mar 24, 2014, 2:34 AM
hi,
try...
also refer
http://www.codeproject.com/Tips/44103/Data-formatting-in-GridView
hope this will help you.
Abhay ShankerPosted Mar 24, 2014, 2:29 AM
System.DateTime.Now.ToString()
Display the date in Gridview as below:-
Munesh SharmaPosted Mar 24, 2014, 2:08 AM
Protected void Page_Load(object sender, EventArgs e)
{
textbox1.text = System.DateTime.Now.ToString() // for complete time and date
textbox2.text = System.DateTime.Now.ToShortDateString(); // for showing date
textbox3.text = System.DateTime.Now.ToShortTimeString(); // for showing Time
}
If you Don't want to show time in grid view then you have to write query
"select id, name , address from tablename"