Cache And Storing A Datetime Format?
Oct 29, 2010I know i can store a string in the cache, but can I save a date in cache and retreive it back into a data variable without having to convert.todatetime.
View 2 RepliesI know i can store a string in the cache, but can I save a date in cache and retreive it back into a data variable without having to convert.todatetime.
View 2 RepliesWhat are the "optimal" parameters for creating an AppFabric cache when you will be storing session state in the cache? MSDN Cache-Related Commands
Powershell command line:
New-Cache [-CacheName] <String> [-Eviction <String>] [-Expirable <String>] [-Force [<SwitchParameter>]] [-NotificationsEnabled <String>] [-Secondaries <Int32>] [-TimeToLive <Int64>]
[code]...
Since I don't want my sessions to be removed unless the session has been abandoned either via code or Session Timeout...For eviction, I would think "None" and for expireable, I would think False.I have tested and calling Session.Abandon does remove the object from the cache. I have also tested to see if by extending my session, the session object in cache is also extended. This does seem to work the "correct" way.
I created a UserControl and added a public DateTime property. I want to set this property in Markup (ie. <cc1:MyControl runat="server" id="MyControl1" DateTimeProp="1/1/2010" /> ) however I live in a place with a dd/mm/yyyy date format so it complains if I set something like "20/1/2010". Is there a way to set markup in my local datetime format or do I have to conform to "mm/dd/yyyy"?
View 2 RepliesI've been tasked with porting/refactoring a Web Application Platform that we have from ASP.NET to MVC.NET. Ideally I could use all the existing platform's configurations to determine the properties of the site that is presented.Is it RESTful to keep a SiteConfiguration object which contains all of our various page configuration data in the System.Web.Caching.Cache? There are a lot of settings that need to be loaded when the user acceses our site so it's inefficient for each user to have to load the same settings every time they access.
View 1 RepliesI am writing a web page that returns a small volume of data from a database table. The database is polled every 1 second and the data will be the same for every user. As every user is accessing the same data, there is no need for each user to poll the database and use up db resource.
Therefore, I think I should be using application caching to store the data in a dataset. However, I am slightly stumped as to how to do this.... because how can i ensure that the dataset is kept up to date.
The only way I can think to do this is to have a master user/session (i.e. the first session in the application) that keeps the cache object updated every second, then other users can use that cache object. If the first session ends, then the next requestor of the cache will pick up responsibility for keeping the dataset up to date.
had a look around and a couple come close to the problem I have, but there more evolved than me, so it seems quite basic.I basically, want to store the current DateTime of when a button is hit. In order to achieve this I have a field in the table of SQL DB called 'TimeStamp' (Although strictly speaking its not, thats just what I've called it) using Datetime Datatype. I think I'm skipping some stages in order to accomplish it, although I'm not sure what it is I'm missing/doing wrong :SHere is my code:
[Code]....
I just have DID have "obj.TimeStamp = DateTime.Now;" but states I need to convert it (unsure how to do) Adding "ToLongTimeString" after .Now asks if I invoked the method. I've also tried a few other ways (saveNow.Now etc... ) but to no avail.
When I first implemented forms authentication I consulted an article that told me to store the user's custom IPrincipal object in the cache. Is this wrong? Should I have stored it in the session?
View 1 RepliesI want to store Date as well as time in a label. The code that i am writing is Label1.Text = Datetime.Now.ToString();
I want to save this value in to the database. This is what i am writing
com.Parameters.Add ("@Dt ", SqlDbType.datetime).Value = label1.Text; // this is the problem.
Currently I am using below code to get March 06. What do I do to get 06 March?
Text='<%# Bind("ToDate","{0:m}")%>'
if i have field datetime = 2010-09-08 11:31:59.123
2010-09-08 17:42:08.737 2010-09-09 9:42:08.737
how can i group by only date? Eg: 2010-09-08 = 2 record 2010-09-09 = 10 record currently when i use group by datetime.. because of the time differece, so it show out all the row.
Sometimes I get a datetime with a time sometimes it's just the date. Of course if it's just the date I I want to format with "dd.MM.yyyy" and if it has a time "dd.MM.yyyy HH:mm".. This is in a repeater, so I thought may be it's possible without a simple if statement?
View 3 RepliesI have textbox on my page as
[Code]....
DateTime format?
View 16 Repliesi have a textbox which contains datetime, i select date with calender extender. In Local, i must enter dd.MM.yyyy format but in IIS, i must enter MM.dd.yyyy formatHow can i solve this? i'm trying to enter dd.MM.yyyy in iis too.
View 4 RepliesHow to format DateTime.ToString(????)Result should look like: 2010-02-05T10:36:26+10:00
View 2 RepliesUsing C# & asp.net
Textbox values are = "04/03/2010"
Format: mm/dd/yyyy
I want to convert the date like this 2010-03-04 instead of 04/03/2010
Format: yyyy-mm-dd
how to make a code for converting this values....
How do i set the DateTime format centrally so that at any time if I use a DateTime.ToString() in my code I get string in the ISO format(eg:2008-2-19 01:00:00) or (2008-2-19).
View 6 RepliesIf I store all my user info, upon login, in cache and just have a "my account" page that displays the user info from cache, is that a good practice? I'm wondering if a person changes his email or does any type of database modification then the cached variables will be the wrong ones. If I have to update the cache variables every time something happens to the database, is this even a good practice compared to just querying the data whenever needed?
View 3 RepliesI am struggling to find out the problem with something. Basically on this page:
[URL]
If you look at the nursery diary tab, will see an article, the first article is named "Test article for archives 1". Now the date should be 01 April 2010, but instead its showing as 04 Jan 2010.
I don't understand why. I have been looking at my insert statement and when i insert in the admin section i have a AJax date extender. And it populates the text box like so '01/04/2010'
But then when i check in my database i notice it has been added as '04/01/2010'.
What does this mean?
My insert statement is like this:
<snip>
The insert works perfectly, but the date format is inserted wrong.
I have dates in my listview with the format "10/08/23,18:16:26-20".
when i am sending this to my database table, it is shown as " 2023-10-09 09:16:26.000".
cmd.Parameters.Add("@ActionDate", SqlDbType.DateTime).Value = Convert.ToDateTime(lvwMessages.Items[i].SubItems[1].Text);
I have date in a text box in the following format "dd-MM-yyyy"How do i convert this into standard datetime format, i could do DateTime.Parse(txtDate.Text).Date but how do i define the current format of this date before parsing, i mean how do i tell the parser that this date is currently in the format "dd-MM-yyyy" usualy parser assume date to be in "MM-dd-yyyy" format i guess?
View 7 Repliesi want to change a colomn Format in SqlServer from ShortDateString to LongDateString();
View 5 Repliesis there any way to set the datetime format of the datafield created in the table? like (datefield name) Date_Time from mm/dd/yyyy to dd/mm/yyyy with no time display and it wont store time in it. and also when we create a variable in vb.net of datetime datatype such as
dim data_time as DateTime
can we set its date format ?? because i want to change it to dd/mm/yyyy but its mm/dd/yyyy by default
DateTime ExpMonth = Convert.ToInt32(ddExpMonth); ---- DropDown(user selects a month)
DateTime ExpYear = Convert.ToInt32(ddExpYear); ---- Dropdown(user selects year)
Datetime ExpDate = ///// I want this part to be saved as Datetime 02/2012
How is this possible?
I have a table in my SQL DB that is a DateTime table, what I want to do is take the numeric datetime it stores and convert it to a long date (i.e. 12/12/2012 conversts to December 12, 2012). Seaching the forums it looks like the string.format is the way to go and searching for info on that I found [URL] which lists all the different formats but they do not list a formating string to convert to the format I want to use. Does anyone know what format string I would use to convert a numeric date to a long date like I want? And can you show it in a code example because I am not 100% sure I understand the code examples shown on that site.
View 4 Replies