|
hi sir,
i want to convert my dd-MM-yyyy to yyyy-MM-dd.
and i am using ToString("yyyy-MM-dd") but it return yyyy-dd-MM.
please help me.
thanks
|
|
|
|
|
Did you check the server's datetime format. The way date is treated depends on the systems' regional settings. Check what is the default date format?
dd-MM-yyyy or MM-dd-yyyy
|
|
|
|
|
Just use split function of string and concatenate it !!!!!!!....I think this may help you.
|
|
|
|
|
I think you need to post the message to the original question. The original author would not have got your reply.
|
|
|
|
|
hi sir,
actually server datetime format is yyyy-MM-dd so that's why i want to convert my dd-MM-yyyy format to yyyy-MM-dd.
and for this i am using str.ToString("yyyy-MM-dd").but this was not working.
i am unable to understand why it converts in yyyy-dd-MM.
please help me for this conversion.
thanks,
|
|
|
|
|
You have to consider 2 settings here -
1. Date time setting on the IIS server - Affects the format in the appl
2. Date time setting on the Database - Affects the format that is stored in the database.
Now, as per our exchanges I understand that your database datetime format is "yyyy-MM-dd" and your application server's date time format is "MM-dd-yyyy".
Your application server is expecting you to pass dates in the format "MM-dd-yyyy", whereas you are sending the date in the format "dd-MM-yyyy". That is why you are facing the following issues -
1. When passing 17-02-2010 [Feb 17, 2010] application throws error.
2. When passing 01-02-2010 [Feb 01, 2010] application converts it to 2010-01-02
The trouble here is that your development machine has local date time settings set to "dd-MM-yyyy" whereas your application server has the date time setting set as "MM-dd-yyyy" hence you are having trouble visualizing and replicating the error in development.
I would suggest, when you first load the date to your date time variable, you split the text as date, month and year and use the date functions to generate the date based on these inputs instead of passing it as one date value. This would ensure that the date values remain consistent across servers with different date time format settings.
Hope this makes sense and helps!!
|
|
|
|
|
vikas shukla wrote: str.ToString("yyyy-MM-dd")
string format="yyyy-MM-dd";
dtm.ToString(format);
|
|
|
|
|
AS an example try like this to correctly format your dates:
Create a web form with 2 labels named lblDateGB and lblDateUS then run the folowing code in the Page Load event:
string dateGB = DateTime.Now.ToString();
lblDateGB.Text = dateGB;
CultureInfo info = new CultureInfo("en-US");
DateTime dateUS = DateTime.Parse(dateGB, info);
lblDateUS.Text = dateUS.ToString();
Note that based on your post the server is defaulted to a US style date so the above should work. The crux is that you are converting the date using a specific culture that matches the server culture so, as long as the original date is a valid date, this should convert it correctly.
|
|
|
|
|
Hi experts ,
As you know we can go to a page by clicking a link or by clicking forward and back buttons of our browser.Is there any way to detect that we are coming to page by clicking 'Back Button ' of the browser , using Javascript ?
With warm regards.
|
|
|
|
|
could you make your question clearer
|
|
|
|
|
Theoretically, We can't control the back button. There is no method or event for that. We can only control how many steps we can go back or disable the button.
April
Comm100 - Leading Live Chat Software Provider
modified 27-May-14 8:49am.
|
|
|
|
|
Hi all,
We have an account of cc avenue , using this when I am trying to post the parameters to cc avenue payment gateway it is giving me the error message as
Merchant URL is Incorrect.
Sorry, Your order cannot be processed as the website is not authorised for Transactions through CCAvenue.
Please contact the Webstore Administrator to report this error.
Can anyone please let me know what might be the problem .
I have made a chat with CCavenue Technical Support team also, they are saying that parmeters have to be posted from the url which is registered with ccavenue and it will not work if we post the parameters from any other urls .But we have other ccavenue account also for which ia m able to post the parameters from my localhost only.
Please any one clarify this
Thanks in advance
|
|
|
|
|
vnr wrote: they are saying that parmeters have to be posted from the url which is registered with ccavenue and it will not work if we post the parameters from any other urls .
It seems that there is some setting in your ccavenue account, where you will set the URL from which you are posting to their site. You might have entered 'localhost' there, which is restricting you to post the data only from localhost. You have to change it as per your current environment.
|
|
|
|
|
Hi Jaans,
Thanks for your reply,
now i got to know about this problem. In CCAvenue there are 2 option one is INR and other is USD .My ccavenue account has been registerd with the USD option.For this type account parameters should be posted from the url which is registered with the CCavenue .But for INR we can post parameters from any url.
|
|
|
|
|
Hi i have a user control, in tht with in updatepanel...,
two link buttons are there using tht i am binding a repeater control values...,
the user control working in some pages and some pages giving error as
"sys.webforms.pagerequestmanagerservererrorexception : input string was not in correct format"...,
see in the following url...,
Right side "Latest/Highest Rated" block inside two link buttons
1) is Latest topic
2) is Highest Rated
Working Url:
http://www.indiainfoline.com/discuss/blogs/[^]
Not working Url:
http://www.indiainfoline.com/Discuss/Blogs/Markets-in-2010-/474397[^]
i dont know whts the exact probs...,
Plz help me out to rectify it...,
Thanks & Regards,
Member 3879881,
please don't forget to vote on the post
|
|
|
|
|
Hi freind,
I want to create dynamic side bar in our product web page by web menu control, it will be dynamic (when we click on top menu a queryString will pass and database will give related products which we want to as side bar in page) , ASP.NET 2.0, C#.
Thanks in advance,
Abbas
|
|
|
|
|
want to integrate windows live messanger in my website and allow chat among the users who logged into the website.
|
|
|
|
|
check thisthis[^]
***** Programme comme si dept soutien technique. est plein de tueurs en série et ils savent adresse de votre domicile. *****
|
|
|
|
|
Hi all,
I have a problem with loading the page for the user,
that is, in my page i am using a repeater control in which the one control will be the crytal report viewer, since the report is big report, it takes more time to set the logon(SQL) informations.
So, i have decided that i can show the other part of the pages to the user and i can show each record completed in the repeated that is,one report is loaded i can show on the page till the other is loaded.
I am using the ajax extensions tool kit dll. and i am using the update panel also
my code is
<asp:Repeater runat="server" ID="POCRepeater" OnItemDataBound="POCRepeater_Binding">
<ItemTemplate>
<table width="100%">
<tr>
<td colspan="3">
<div>
<CR:CrystalReportViewer runat="server" ID="CRViewer" DisplayToolbar="False" SeparatePages="false"
DisplayGroupTree="False" EnableDrillDown="false" EnableViewState="true" />
</div>
</td>
</tr>
</table>
</ItemTemplate>
</asp:Repeater>
the repeater coding alone i have give,
how to do the partial updated page showing in the page??
i will give you a website which is loading like the same,http://www.dinamalar.com/[^]
this is my language website, as many of you may not know what is that,but the content in the page loads as what i said above,
help me thanks in advance..
|
|
|
|
|
Hey guys, I have downloaded a ready template, a simple css HTML template from template monster and I want to use it in my master page, is there a walk-through o tutorial for that ?
Thnx
|
|
|
|
|
The only thing that you have to do is to learn CSS and see how the CSS written in the template. Create appropriate alteration and then add to your project.
Consume the css classes from your masterpage markup.
|
|
|
|
|
I've created a small .Net webApp (ClassRegWebSolution), and what it does is to register students. However this webApp only runs on one system (i.e: The same system is the client and the server), but the DB resides on a central server elsewhere. I want to capture student images on the web page via a webcam, but can't accomplish this. So i've decided to write a winApp (imageCapture) that can capture images real-time.
The problem now is calling the imageCapture to run when the user clicks a button on the .aspx page.
Pls how can i acomplish this?
He who goes for revenge must first dig two graves.
|
|
|
|
|
I would investigate ClickOnce[^]
"ClickOnce is a deployment technology that allows you to create self-updating Windows-based applications that can be installed and run with minimal user interaction."
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
No man, its not possible. One thing is possible for your case is to embed a Web Browser control and navigate to the page and invoke this from your win app directly on the web event. Otherwise if you want to access your win app from normal browsers, it cant do.
There is another alternative as well. I thought you said that both windows application and web runs on the same system. In such a case you can use a direct call to your webcam from the server side too. but this will only work from the server.
Hope this would help you.
Cheers.
|
|
|
|
|
If your windows & web application resides on same system/server
you can use System.Diagnostics.Process to run your window application.
System.Diagnostics.ProcessStartInfo info = new system.Diagnostics.ProcessStartInfo("D:\MyWindow.exe");
System.Diagnostics.Process p1 = System.Diagnostics.Process();
p1.StartInfo = info;
p1.Start();
|
|
|
|