|
Hi All,
We have 2 sites.
1) suppose that one of the 2 sites has been uploaded under following url:-
http://www.abc.com/
2) we need to read above site web.config for our other site which has uploaded in different location.
http://www.abctest.com/
How do we read 1) site web.config from second site using c#, asp.net?
Thanks in advance.
|
|
|
|
|
Just read the file as XML from the file system path....
|
|
|
|
|
It is not possible to read web.config from one server to another because web.config is assign to each application not to server.
|
|
|
|
|
If it is in another server you need to read it using Unc path.. You cant access Web Config from http requests as they are secure to the web site.
Web config is applied to a virtual directory in the IIS. So you can have web.config file for each folder within your project. If not found it applies the parent.
|
|
|
|
|
string fromdate= "31/08/2009";
string todate = "20/08/2009";
i have to decrase a day for the todate can u plz specify how to decrease the date for one day...
string fromdate ="31/08/2009";
string todate = "20/08/2009";
string newdate =(DateTime.Parse(todate ).AddDays(-1)).ToString("dd/MM/yyyy");
but it was showing error
modified on Monday, August 31, 2009 4:23 AM
|
|
|
|
|
You do not have semi-colons in the first two statements. Is that a typo or the problem?
If that is typo, then post the error message you get.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
its there man
thats not a big issue
|
|
|
|
|
What is the error it is throwing then?
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
it was not reducing the day but it was not reducing the month
|
|
|
|
|
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. .
|
|
|
|