I have a column name as CREATEDATE. I use this sqlcommand to get the information
string sql = "SELECT USERID,USERNAME,USERPOSITION,UPDATEUSERID,USERSTATUS,TO_CHAR(CREATEDATE, 'DD-MM-YYYY HH24:MI:SS') FROM USERMASTER WHERE USERID ='" + stat[0] + "'";
I bind them in to dataset ds.
when I want to get the data of TO_CHAR(CREATEDATE, 'DD-MM-YYYY HH24:MI:SS')
I try to assign this way.
lblCreatedOn.Text = ds.Tables[0].Rows[0]["TO_CHAR(CREATEDATE, 'DD-MM-YYYY HH24:MI:SS')"].ToString();
its throw me an error call Column 'TO_CHAR(CREATEDATE, 'DD-MM-YYYY HH24:MI:SS')
' does not belong to table Table.
anyone know what the column would be?
Sometimes in few applications, the alias needs the keyword
AS
to qualify as an alias. Or, may be you need quoted identifier, i.e. use double-quotation marks.So, modify it as: