I have a form and I want to insert the current time at which the user clicks to insert into the table of my db.
When running, I get the following error when trying to insert into my sqldatasource:
"System.FormatException: String was not recognized as a valid DateTime."
I want to create a function that a web method will call - and that function will be in a DLL.
I am assuming that having that function in a DLL is better then leaving it as source since it won't recompile when IIS recycles or whatever schedule that falls under.
Do I need to make this function in a different project (solution) and compile it down to a DLL and then refer to that folder location in the WEB.CONFIG?
And I assume I just put it in the BIN folder in INETPUB - right? Do I need a WEB.CONFIG reference to it as well - in production?
I have a web service that takes an XML string for input and saves the XML to a file. The filename is created from the date and time and a random number generator. The program also edits the XML as it processes, and there can be errors. When there's an error, I create an email which describes the error and then repeats the XML in the body of the email. I am using another web service written in-house to send the email.
I want to include in the email a link to the filename I saved. What is the best way to do this? I think I need to use HTML, but there's an html flag I pass to the email web service which needs to be false. When it was true, the XML wasn't formatting.
I have a Visual Studio 2008 solution that when I build, returns the following error:
Ticks must be between DateTime.MinValue.Ticks and DateTime.MaxValue.Ticks. Parameter name: ticks
There is no reference file/line/column in the error. Becoming quite frustrating as the solution builds in the end, however I cannot debug.In the solution, there is no reference/using to DateTime.MinValue.Ticks at all...
EDIT:
There are only 2 references to ticks in my solution, and neither of those are causing the issue.There are no constructor issues with DateTime either. I do not believe it is related to DateTime or ticks at all.I have found a similar reference where it turned out to be a corrupt image file in the solution, where it did not have a date-modified value. This is not affecting mine though.
I have written a code to insert emp details into database and i am also inserting local date(i,e system date) into to the table to know/have an idea at what date the employee inserted details. I have set date format add/MM/yyyy and its working well in my local system, but after uploading the site into server (the server is shared server) iam getting error and the error message is Failed to convert parameter value from a String to a DateTime.
Surprisingly, it is working well in server when i chaged the date format to MM/dd/yyyy, but now its not working in my local system and getting the same error.
I have a textbox that I use to gather a date. I would like to have the database store a null if this field is left blank by the user when submitting. I am using the following on my aspx page:
One of our customers has a report with a single value string parameter that has over 1000+ possible values. selecting single value from 1000+ choices results in bad UI, among other things.create another parameter that acts a filter for the other parameter. So you would have Param1 with say 25 choices and selecting a choice would narrow down the option for the second parameter.Is this the best way. What is the best practice for handling these kinds of parameters?
Every single parameter is bound just fine except toDate which turns out to be always null. When inspecting the Request.QueryString["toDate"] it retrives the right value which is 30/09/2010. It seems that DateTime expects another format when binding. What is the right format?
My brain doesn't seem to be working today. I googled around for this and just couldn't find it, which seems kind of strange since this is such a basic question that I can typically find out very quickly.
I'm trying to create an array of DateTime objects. I can't use a List.
I'm really drawing a blank on this one. I've been working on globalization but the DateTime seems to always revert back to the CurrentThread's culture.
I've got a textbox with the date expressed as a string:
// the CurrentThread's culture is de-DE // My test browser is also set to de-DE IFormatProvider culture = new System.Globalization.CultureInfo("de-DE", true); // en-US culture, what I'd ultimately like to see the DateTime in IFormatProvider us_culture = new System.Globalization.CultureInfo("en-US", true); // correctly reads the textbox value (22.7.2010 into a datetime) DateTime dt= DateTime.Parse(txtStartDate.Text, culture, System.Globalization.DateTimeStyles.NoCurrentDateDefault); // correctly produces a string 7/22/2010 string dt2 = dt.ToString(us_culture);
At this point I want a DateTime that's in en-US I've tried both:
But both produce de-DE DateTimes. My motivation in asking this question is the rest of the business logic is going to be calling dt2.toString() and will result in an incorrect date time string. I realize I could change toString() to be toString(us_culture) but I'd rather not change all of the rest of the business logic to accomodate this change.
Is there a way to get a DateTime in a culture other than the CurrentThread's culture?
i want to create a datetime object in the way dd/mm/yyyy but the defualt behaviour of datetime object is mm/dd/yyyy. I want this because my user enters date in dd/mm/yyyy format and i want to apply different additions and subtrations on this format. I know how to display dates in different formats.
I have to develop an authorize filter in asp.net mvc.I have got five categories of users in my site and my site uses custom created authentication system.Now i have a controller action which should be accessible to 3 out of those five type of users.How to create a filter (basically authorize) and use it which fulfills my requirement?I think i need to create the authorize filter with parameter.I should be able to use something like this in my controller action.
Authorize[UsersType="admin,accountant,operator"] public ActionResult Test() { }
[URL]as the iage upstairs i have to create a filter in my sql stored procedure so, my difficulties is switch the "and" and "OR" paramers located in the webFormhow can i do that?i was thinking to save in a temporaney variable : @temp='and field=1' but my difficulties is to concatenate with a principal query and execute it
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"?
I'm creating a reports with the following filter criteria:
ID - textbox Created Date - range between start and end date Syste Name - dropdown Users may filter the report based on the ID or System Name or all the criteria mentioned.
The search Field for ID, by default has a Null checkbox beside on it while other filter doesn't. how can I enable the checkbox for the other filters?
So I came across this article which should my issue. Apparently, I'm receiving a formula error "The arguments to the following functions are not valid:FIND" with this formula OR(FIND(Creation Date, Parameter: Creation Date)<>0, Parameter : Creation Date = Empty). see this link for the screenshot. I don't know what I'm missing. I'm using Reporting Services 2005
I am trying to store a SQL Server datetime into MySQL datetime field, but MySQL stores the date value as all zeros. I use this function to trim the fractional part from the SQL Server datetime, but get the same result when trying to store it in MySQL.
I want to create a common unit test function to check all functions based on parameter
for e.g
[code]....
what logic should i write inside this method so that by passing a actual function in parameter methodname and then the common method should execute that function and should return the output.
i am using entity framework for all functions which has been created in my project and now i dont want to create a separate unit test function for each function.just one function should do the job based on different parameters...
I am selecting some data from a access database which is in Date/Time format in the Database and also in the programme the variable the information is stored in is registered as Date/Time.
However when I run the programme it says there is a data type mismatch.