|
Actually the problem is DateTime parses according to the CultureSettings applied on the computer. If your global Date format is MM/dd/yyyy you cannot parse in dd/MM/yyyy.
You can specify format while parse, using ParseExact function rather than Parse .
|
|
|
|
|
No overload for method 'ParseExact' takes '1' arguments
iam getting dis error
|
|
|
|
|
use this
DateTime dt = DateTime.ParseExact("18/02/2001", "dd/MM/yyyy", new CultureInfo("en-US"));
You will get what you want.
|
|
|
|
|
try this code to decrease the date
Label1.Text = DateTime.Now.AddDays(-1).ToString();
after u Get date time u can change as per your Requirement
modified on Monday, August 31, 2009 5:32 AM
|
|
|
|
|
iam not asking for lable ...
iam getting a date in string format i want to decrease the particular date which is in string format
|
|
|
|
|
Convert the string format date into Datetime format i.e. use the following code
DateTime dt = DateTime.ParseExact("25/11/2009", "dd/MM/yyyy", new CultureInfo("en-US"));
or u Can Use This
string ssd = DateTime.Now.AddDays(-1).ToString();
DateTime asd = Convert.ToDateTime(ssd);
ssd = asd.AddDays(-1).ToString();
if this is not Your Answer I am Sorry..!
modified on Monday, August 31, 2009 6:07 AM
|
|
|
|
|
you can do by this, just remove the opening and closing brace.
string newdate =DateTime.Parse(todate).AddDays(-1).ToString("dd/MM/yyyy");
|
|
|
|
|
Hi ,
First parse string into date format and remember u should use yyyy/mm/dd format.
datetime date = datetime.parse(date);
date = date .AddDays(-1)
Thanks,
Amit Patel
|
|
|
|
|
just get month year day through substring
string year = txtdate.Text.Substring(6, 4);
string month = txtdate.Text.Substring(3, 2);
string day = txtdate.Text.Substring(0, 2);
DateTime dt=DateTime.Parse(year+"/"+month+"/"+day);
string date = dt .AddDays(-1);
|
|
|
|
|
string year = txtdate.Text.Substring(6, 4);
string month = txtdate.Text.Substring(3, 2);
string day = txtdate.Text.Substring(0, 2);
DateTime dt=DateTime.Parse(year+"/"+month+"/"+day);
date = date .AddDays(-1)
txtdate is the textbox for date input
|
|
|
|
|
How to configure sql server 2005 For Remote Connection.
I have to access local sql server with web Aplication.
|
|
|
|
|
|
Hello Sir
I had tried All This link,
But it is not working.
My Sqlserver is on local machine which is connected in a netork. On which internet connection is through D-link router.
i am passing user id and password also.
I want to access sqlserver 2005 through internet (i.e Web application)
it gives following eror
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
|
|
|
|
|
Sorry Dude I dont Know the Answer U better Post this Question in System Admin Blog or General Datase blog Rather Than Asp.net Blog
|
|
|
|
|
i m using C#.net application with accessdatabase
i m trying to display primary key in textbox
but it is giving the error "data type mismatch"
the primary key datatype is "Autonumber"
can anyone tell me that how to make textbox compatible with numbers
thnx
|
|
|
|
|
Well.. this is no big deal,
int autonumber = 29;
yourtextbox.Text = autonumber.ToString();
Cool. .
|
|
|
|
|
i dont understand ur problem
try
textbox1.text=dr["columnname"].ToString();
|
|
|
|
|
Hello all,
I have created an application using third party literary and also added the .exe
file in scheduler that will run after every after 1 hour. But the problem is that
before running the code a popup come is displayed and when i click on "OK" button in the popup then the code will start to run. When i setup a task in scheduler then no one will
be there to click on "OK" button in popup and without clicking the button code will not run.
Could you tell me what can do to disable the popup or any other solution?
Thanks
People Laugh on me Because i am Different but i Laugh on them
Because they all are same.
|
|
|
|
|
I think you need to create Windows Service to do this job. Open the process in hidden mode from the Windows service and do the job. Windows Scheduler does only call the exe, and it will open up.
I am not sure if there is any facility to hide the popup in the existing windows scheduler.
|
|
|
|
|
Hi
Some body has told me that we can execute scheduler in silent mode.In silent mode
it won't ask for confirmation.
Do you know about that?
People Laugh on me Because i am Different but i Laugh on them
Because they all are same.
modified on Monday, August 31, 2009 6:14 AM
|
|
|
|
|
Hi all ,
how to integrate payment gateway with the asp.net application using C# and also i want to know whether i need to contact with bank
thanks,
Amit Patel
|
|
|
|
|
They Are many gateway providers in the web .Theese are some gateway providers
Pay Pal
Authorize.net
They Will provide the code as per the requirement You Can check their website
this is the link for authorize.net
http://www.authorize.net/[^]
And Paypal
https://www.paypal.com/in[^]
|
|
|
|
|
No you dont need to contact with bank just take the service from any of these payment gateway they will provide their own api that have to implement in code.
Linkpoint, Chase, Authorize.net, cybersource, paypal, etc.
|
|
|
|
|
Hi,
I am New to MVC Framework.
Is it possible to use already present ASP DotNet Code in MVC Arcitecure?
If yes then what are the ways in doing it..
and also can we utlise already created DLL in ASP Dot net in MVC?
Thanks in Advance..
Regards
|
|
|
|
|
hi,
plz,
tell me, can we use session in source (javascript function in aspx file) file.
if yes then plz tell me syntax of it.
My fun is,
function PikCode(textid)
{
String myval = document.getElementById(textid).value;
Session["txtcode"] = myval;
}
<script>
but wen i use session in cs file, it become null.
Thanx in Advance.
|
|
|
|