|
Alright cool. I recognize that form from the Image class.
thanks. thats perfect.
1 line of code equals many bugs. So don't write any!!
|
|
|
|
|
I have a popup datepicker in my application which is ran using javascript. When I run my application from my pc it works fine but wehen I run my app from a server it causes a problem. The problem is that if I select a date like today 02/05/2006 this will go into the field on my app, when I submit the form in the date goes into the datbase field as 05/02/2006 which is the wrong way round. I am using GMT as the time zone regional setting. The field in the database is datetime.
Anyone any ideas why this is happening?
macca
|
|
|
|
|
Simple. Its getting converted to the american format of storing dates. The solution is very simple. Just before writing to the Database, make sure that you pass it as a DateTime variable using some syntax like,
DateTime dt=DateTime.Parse(dtPicker.SelectedDate.ToString("dd-MM-yyyy");
Hence even if a value such as 02/05/2006 is stored in the database as 05/02/2006, while retrieving it will still get you 02/05/2006 once you get it with the same format as dt.ToString("dd-MM-yyyy");
|
|
|
|
|
It is being passed into the stored procedure in the British format, so I think I need to do the conversion you are proposing in the datbase itself. Can I use your code "DateTime dt=DateTime.Parse(dtPicker.SelectedDate.ToString("dd-MM-yyyy");" in the stored procedure?
I need it stored in the dataase in the correct format as I run some other queries based on the dates i.e. select all between two dates.
macca
|
|
|
|
|
The answer is that using dd/mm/yyyy and/or mm/dd/yyyy is ambiguous - it looks like your webserver is configured to use UK date format, but that your sql server instance has been installed to use US format.
I have always gotten around this by using an unambiguaous format. So either:
1) 2 May 2006
2) 2006/05/02
Both are unambiguous and will never cause the problems you specify.
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|
|
Well...If you are confident that its being passed into the Stored proc in British Format, then while retriveing it just use the ToString() method as ToString("dd-MM-yyyy"). It should get you the date in british format.
By the way, the code dt=DateTime.Parse(dtPicker.SelectedDate.ToString("dd-MM-yyyy");
WILL NOT work inside the Stored Proc as this is not a T-SQL statement. It works only inside .NET.
|
|
|
|
|
Hello,
I want to display a report like the one given below in ASP.NET1.1 using any of the web server contrls such as Repeater, DataView, DataList etc. This report is a little different from a table like report in that it has section headings such as Status:Enabled, Status: Disabled etc. My stored proc returns all the data at once sorted using the status code (2:Enabled, 1:Disabled, 0:Temporary etc). Any help is appreciated. I guess the DataGrid is not very usefull if you want your tables to be formatted...like in this case I want a sections-based report. Many thanks
Status: Enabled
Code Name Decimals Sort Order Country
---------------------------------------------
GBP Pound Sterling 2 1 United Kingdom
EUR Euro 2 2 European Union
USD US Dollar 2 3 United States
Status: Disabled
Code Name Decimals Sort Order Country
---------------------------------------------
AFA Afghani 2 99 Afghanistan
DZD Algerian Dinar 2 99 Algeria
Siva
|
|
|
|
|
|
Hi I am showing a pop up through javascript when a mouse is pointed over the image, the image is shown as pop up. It is working fine on local machine. But when i open it on a client machine, a gap equal to the pop up page appears on the top of that page. I want to remove this gap.
Moreover this code for pop up image works fine on internet explorer 6.0 but when run on Mozilla firefox , it doesn't work.
Thanks,
Sandy
|
|
|
|
|
I am adding two cotrols to a panel. Currently, the controls are appearing next to each other. I want the second control to appear at the bottom of the first one. For instance, currently, they appear as: 'Label' 'Checkbox'.
However, I want them to appear as:
'Label'
'Checkbox'
How do I do this?
I have this code:
Panel panel = new Panel();
Label pr = new Label();
pr.Text = "some text";
panel.Controls.Add(pr);
CheckBox BasketCheckBox = new CheckBox();
panel.Controls.Add(BasketCheckBox);
Kind regards
|
|
|
|
|
What I need is this:
panel.Controls.Add(new LiteralControl(" "));
before adding the checkbox
|
|
|
|
|
Hi,
I am working with AsP.Net. At the page load my Dropdown list is populated with the first data. I am using data set to do it.I need the dropdown appear to be blank on the page load and need to see the data only on clicking on the dropdown list. Can any one help me in doing the same.
Jayakrishnan
Chennai
|
|
|
|
|
You could 'save' the drop down list data in a javascript array on the page and then implement an onclick event for the drop down list that would call to a javascript function to create and populate your dropdown list.
|
|
|
|
|
hi,
Thanks for the suggestions i have got. but i was able to manage it by adding the code
cmb_RepairCode.Items.Insert(0, "")
to the existing code
Thanks,
JK
|
|
|
|
|
Aha, your problem was quite a bit simpler than i understood it to be...
|
|
|
|
|
Hi,
Now i am working on updation of existing project..
when i run it, i am getting one error in web.config file..
that is
Error Like .....
"It is an error to use a section registered as allowdefination = "MachineToApplication" beyond application level. this error can be caused by virtual directory not being configured as an application in IIS"
and showing the cursor at <authentication> tag in web.config...
Plz reply me if you have solution...
Balu
|
|
|
|
|
Is the app configured as an application in IIS? go to IIS manager, expand the website to the directory containing your app, right click, go to properties and there should be an entry in the application settings/starting point. If there isn't then click the 'create' button beside it.
|
|
|
|
|
Hi
I want to upload folder (with files & subdirectories) from client machine to server. i am able to upload file with file control. but how can we upload folder..
Advance Thanks
Hema
|
|
|
|
|
You can't (unless you are going to use java applet)
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
What is the main diff. amoung DataSet, DataView, Repeater
which shold be used when
plz reply
Kindly send me feedback
Thanking you,
|
|
|
|
|
A DataSet is used to hold DataTable objects. Usually a DataSet contains one DataTable that is fetched from a database.
A DataView is used to filter and sort data from a DataTable.
A Repeater is a designer control that takes a data source (for an example a DataTable or a DataView) and repeats it's contents for every record in the source.
---
b { font-weight: normal; }
|
|
|
|
|
What is the main diff. amoung DataSet, DataList, Repeater
which shold be used when
plz reply
Kindly send me feedback
Thanking you,
|
|
|
|
|
Hi
Can any body please help me with this problem:
Im trying to check the access rights(Read/Write) to a particular folder before inserting/updating any file to that folder.
Thanx in advance.
|
|
|
|
|
;PThanks a lot for your sincere coporation.
Sir/Madam now i have a problem that I have to create row runtime according to the value passed to them. My question in detail:
In Rajasthan we have 32 district and on those district they have differet tehsils. i have to create row according to the tehsils.on Button click.
Balwan Singh
|
|
|
|
|
Try using the Table control.
-
बुरा जो देखण मै चला, बुरा न िमलया कोय,
जो मन खोजा आपणा तो मुझसे बुरा न कोय।
Translation
|
|
|
|