ADO.NET :: Apply Add Hour Function In Linq?
Jan 22, 2011
var LateChangesTodate = (from lt in entities.Histories
where lt.RequestDate < dt && (lt.EmailDateA != null ? lt.CompleteDate.Value.AddHours(-48) > lt.EmailDateA : lt.CompleteDate.Value.AddHours(-48) > lt.RequestDate)
[code]...
View 5 Replies
Similar Messages:
May 7, 2015
I want to call a function on every after one hour. I wrote this function in Global.asax file on Aplication_Start event. Its work fine in Local Host but not working after publishing it on web server.here is my code:
protected void Application_Start(object sender, EventArgs e)
{
Application["UsersOnline"] = 0;
[code]....
View 1 Replies
Mar 11, 2011
I am devoloping a Web Application, in which one Page has some neccessity that User should select any folder in the System and for ex if he selects ex:D:xyz, then this Path should be Saved in Database, I have written the Code for Storing in to Database and Remaining Every thing. But actually i think that if it is like a Browse Button click function to select the Folder, what i have made is, as i dont know how to make it in Web Application simply i used a textbox to be able to user to type the Path.
View 3 Replies
Apr 1, 2011
I have created an Entity Model (.edmx) file with MySql database.I added some tables and then try to apply some linq to sql expression but for each expression it thorws an error "Object Reference not set to an instance of the object"
[Code]....
whichever function I call, I get the same error : Object Reference not set to an instance of an object.
View 5 Replies
Mar 25, 2011
I have a SQL view that uses the LOG() function. How can I do the same in a LINQ query?
View 6 Replies
Aug 4, 2010
i have my page who load my gridview as: GRW.datasource=className.List2(2);i have this function in my class
[Code]....
it returns an error , cannot convert single result to queryable!! in " blo= DB.MarketList(TypeID);"
View 10 Replies
Sep 6, 2010
i have an problem to use of PATINDEX function in select clause with Linq.
View 1 Replies
Mar 19, 2011
I want to simply search a database for a certain string, how can i accomplish this using linq and EF (if using these tools for it are not practical). I just want to take a string and search my usernames, the search should be able to handle things only parts of the username (using some sort of 'contains' function)
View 1 Replies
Feb 24, 2011
i want to use a function to get all the fields from a LINQ table as ill be using this table alot i thought putting it in a function would be quicker
how can i get all the fields and all the field data from linq table and use it in a function
for example
var address1 = FunctionName.Address1
var postcode = functioname.postcode
or however i can make this work
[Code]....
View 1 Replies
Apr 8, 2010
I have a problem here.In my database I store member status in 1 and 0, when it come to my gridview I need change 1 and 0 to active and inactive. My company is using Linq, so I must follow. I wrote in this style, I calling a changeToWord() function to change 1 and 0 to active and inactive.
var q=from a in db.members
select new{
mem_name=a.name,
status=ChangeToWords(a.status)
}
It compiles with no error, but when I execute the page, it prompt out a error message to me.
View 3 Replies
Feb 1, 2010
I'm trying to populate a treeview control using linq.
I use the following code
[Code]....
how can I declare c in fillChildren
View 2 Replies
Aug 13, 2010
I had a friend ask me about writing a program that would allow data entry and then run and display a report each day at 11:00 am. What is the best/easiest way to make the report run at a specified hour? He wants something that can run on a standalone (laptop) computer running windows xp. Most of my experience is with asp.net and c#.
View 4 Replies
Jan 6, 2010
i would like to add one hour to this two dates bellow:
DateTime sd = DateTime.Parse(calendar.m_Start.ToString());
DateTime ed = DateTime.Parse(calendar.m_End.ToString());
string strSD = sd.ToString("dd. MMM HH:mm", System.Globalization.CultureInfo.CreateSpecificCulture("oo-OO"));
string strED = ed.ToString("dd. MMM HH:mm", System.Globalization.CultureInfo.CreateSpecificCulture("oo-OO"));
They are output here:
Response.Write(" <start_time>" + Server.HtmlEncode(strSD) + "</start_time>" + Environment.NewLine);
Response.Write(" <end_time>" + Server.HtmlEncode(strED) + "</end_time>" + Environment.NewLine);
View 3 Replies
Jan 1, 2013
I am developing an intranet web application. i am using asp.net,C# and MS sql. Now i want to make everyone hour to bring a grid view page with lists of names whose contractperiod is expiring soon. So how do I make an asp.net page to be pop up every hour.
View 2 Replies
Sep 6, 2010
i want to change the hour that i get from date.now because the server is in different country and we have 2 hours difference.
View 19 Replies
Apr 22, 2010
I want to increase the session time,By default the session will expire in 20 minutes,I want that session will expire in 1 Hour,Hw to to dat?
View 11 Replies
Aug 12, 2010
Is it possible to have a thread running "for ever"? even when the browser is closed?
I tried this in my global.asax:
[Code]....
But without result. It works for about 20 seconds and then it stops until a new user opens a page.
View 5 Replies
Dec 30, 2010
i have used the Created_Date = DateTime.Now, to set the default value of a datebut i want that date to include inaddtion to the day the hour minutes and seconds
View 6 Replies
Oct 5, 2010
[Code]....
How to convert days into hours?
View 4 Replies
Sep 27, 2010
I have a page that does an upload of an xlsx file to a datatable and write into SQL.
That is working, my problem is when i upload the file and pass the values to the datatable some of them are showing in the wrong format and the column name dont
appears.
e.g.:
Hours at home
Hours working
3:00
8:00
01-01-1900 1:35:00
01-01-1900 2:35:00
01-01-1900 3:35:00
The first 2 columns its how i want the info the third is how my problem looks like.
I've tested and the problem occurs when the same column has more than one value.
The format of the cells is h:mm if i change it to text it works fine but i dont want that because the time will be converted to semething like this 0,123456789.
I dont know if it matters but the xlsx file is kinda complex and has 10,2MB.
View 5 Replies
Jun 10, 2010
I have a DateTime column in my SQL database, how do I check if the Day in that is Today, or yesterday?
What I want to is something like: If date is today then the result would be "Today, at " same for yesterday..
View 6 Replies
Oct 14, 2010
I have a timestamp column which I require to change the time back by 1 hour for all records.
View 5 Replies
Dec 17, 2010
my Global.asax file looks like this -
[Code....]
From some reason that I am not aware of Application("vCounter") reset to its initial value (0) every hour (i think).
View 1 Replies
Oct 15, 2010
i have a table which records visits to a page, what i want to do is get a count of the last 24 hours and group the visits by the hour.
This is my table structure;
ID, ChannelNewsID, AddDate
This is what i did so far however it gives me both past and future records where as i want 24 hours previously starting from when the query was run. Here is what my query looks like;
[Code]....
View 7 Replies
Nov 16, 2010
I have requirement to show time in 24 hour format.
Right now code is like this
PorudctInfo.ReturnDate.ToString("yyyy-MM-ddThh:mm:ss").
Right now for eg return date time is "2010-11-17T01:15:00"
I want it in 24 hour format I should get it 13:15:00 format
View 2 Replies