c# - How Store datetime value in to local datetime variable? -


I am storing some values ​​in sessions and some columns date time < / Code> Retrieve the value where the clause and use this session value code:

date time current date = default (date time); Session ["d_id"] = dt.rows [0] ["d_id"]; Current day = objdl.GetScalerValue ("Select IsNull (Max (Login Date), GETDATE ()) from q_logintrack_panel where id = '" + session ["d_id"]. ToString () + "'");

Here the error occurs in the third row.

  Error: The string can not be changed explicitly in the system. Data Time  

Please give me the exact solution ...

You need to parse the returned string returned by GetScalarValue for the DateTime object:

  Datetime current date = default (datetime); Session ["d_id"] = dt.rows [0] ["d_id"]; Var dtStr = objdl.GetScalerValue ("Select IsNull" (Max (Login Date), GETDATE ()) from q_logintrack_panel where id = '"+ session [" d_id "]. ToString () +"' "); Current date = DateTime Purse (dtstr);  

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -