DateTime.ToString("d") still displays time (12:00:00 AM)
I'm trying to format a datetime variable to display the shortdatestring in a dropdown list in asp.net 2.0 but it still displays the time. I've tried .ToShortDateString, ToString("d"), ToString("MM/dd/yyyy"), but I always get 01/01/2006 12:00:00 AM.Public Overrides Property WeekDate() As System.DateTimeGetReturn MyBase.WeekDate.ToString("MM/dd/yy")End GetSet(ByVal value As System.DateTime)MyBase.WeekDate = valueEnd SetEnd PropertyAny suggestions?
once you've gortten your datetime converted to a string, you need to keep it as a string.you...
Datawindow columns with "Transparent" background color & format as "$#,##0.00;[RED]($#,##0.00)"...
Hi,
We have several datawindows with currency columns having "Transparent"
background color & currency format ("$#,##0.00;[RED]($#,##0.00)"). Due to
this format, the negative amounts would be red in color (for eg.
(1234.56) ).
When we print this datawindow in some printers (like IBM 24PS printers), the
columns with negative amounts wouldn't get printed. Please note that this is
not happening in other printers. Please also note that if I change the
background color of the columns to "White", the printing is fine. Anybody
have similar experien...
Response.Cache.SetExpires(DateTime.Parse("1/1/2003 12:00:00 AM"));
I found this code in a legacy application I am working on. It seems this is being called in the page load of nearly every page on the site.
I did some research and could not exactally figure out why this was done. Could someone give me some insite as to what this would do?ThanksJeff
To prevent the browser from caching the page.Darrell Norton, MVPDarrell Norton's BlogPlease mark this post as answered if it helped you!
do you have any thoughts on why someone would do this?ThanksJeff...
Setting a valid default DateTime value (It doesn' t accept "00/00/00")
Hi,I am sending a date interval to the DB so that the user can search orders by specifying such interval. Somebody knows how can I pass a valid default DateTime value to the DB in case the user has not specified a date?For example:
Sub search_orders(Sender As Object, e As EventArgs) Dim fromDate As DateTime If fDate.checked = True Then fromDate = f_date.Text Else fromDate = "00/00/00" End If Dim toDate As DateTime If tDate.checked = True Then toDate = t_date.Text Else toDate = "00/00/00" End If
Response.Re...
what is the difference bettween string.Format("{0:#.##}", and string.Format("{0:0.00}"
they both seem to do the same thing, what is the difference functionality that # versus 0 ?
string.Format("{0:#.##}", mydecimal);
string.Format("{0:0.00}", mydecimal);
Look here: http://msdn2.microsoft.com/en-us/library/0c899ak8.aspx
Hope it helps
Hi,
As far as I know, they both are different.
0.00 can remain the position all the time. For example, decimal is 0.1 and then it will return to you with 0.10 by 0.00 format.
With #.##, it will cut the unnecessary position in the decimal. For example, decimal is 0.1 and then i...
convert BASDA format XML to "standard" XML
hiya,
Many of my recent problems have been that I have found it difficult to get my head round using XSLT on BASDA format XML.I feel that it would be easier to convert the BASDA format to "standard" XML, then do my XSLT.
--BASDA snippet
<rows>
<row>
<FIELD NAME="PRODUCT-TYPE">CAR</FIELD>
<FIELD NAME="PRODUCT-DATE">01/01/2004</FIELD>
</row>
</rows>
--what I regard as "standard" XML...easier to work with.
<rows>
<row>
<PRODUCT-TYPE>CAR</P...
lblOverhead.Text = Format(.Rows(k)("sc_op_ovr"), "#,##0.00")
Hi All,
What format "#.##0.00", this will accept? Pls give me one example.
Thanks and Reagards
Abdul M.G
Hi There,
Have a look at this article:
http://msconline.maconstate.edu/Tutorials/ASPNET2/ASPNET07/aspnet07-01.aspx
Scroll down to Custom Format Strings
Hope it helps!DC517Don't forget to click "Mark as Answer" on the post that helped you. This credits that member, earns you a point and marks your thread as Resolved....
Format numeric value to "##,###.00" format.
how can i format a numeric value to a format with "," for thousands.. and 2 decimal places...
I tried String.Format("{0:N2}", value)... and String.Format("{0:F2}", value) but its not right...
either thousands "," is not showing.. or no decimal places.Alvin ShihSoftware DeveloperMCP MCTS MCPD
String.Format("{0:#,###.##}", Number);
or
String.Format("{0:#,###.00}", Number);
depending on ur need
Vikram www.vikramlakhotia.comPlease mark the answer if it helped you
You can use this String.Format "###...
Cast from string "00/00/00" to type 'Date' is not valid
hi,
I am trying to solve this proble, for over 2 days and still.. i couldnt solve it
i am getting this error:
Run-time exception thrown : System.InvalidCastException - Cast from string "00/00/00" to type 'Date' is not valid.
how do i put "00/00/00" or even a NULL value ??
DATEE is diffine as datetime type in the data basenewNode = xmlTos.CreateElement("DATEE")
newNode.InnerText = ="00/00/00"
'If Not IsDate(newNode.InnerText) Then
' newNode.InnerText = DBNull.Value 'System.DBNull.Value.ToString
'End If
If n...
How do I parse XML attribute value "2008-02-13T10:15:04.0000000-06:00"?How do I parse an XML timestamp attribute value
"2008-02-13T10:15:04.0000000-06:00" in SQL Anywhere 9.0.2?
E.g....
<xxx yyy="2008-02-13T10:15:04.0000000-06:00">
Prior to this I was receiving *ordinary* timestamp values like
"2008-01-31 12:34" and the following Xpath query worked OK...
INSERT aaa
SELECT * FROM OPENXML (
@xml,
'/bbb/ccc/xxx' )
WITH ( other columns...
...
yyy TIMESTAMP './@yyy' );
Breck
--
Breck Carter http://sqlanywhere.blogspot.com/
RisingRoad SQL Anywhere and...
"Attempt to use an "XML" extension that has not been registered..."
Hello, I am using Reporting Service in server mode.I currently have a report in which in include a few subreports. All of them use the same datasource (sqlserver 2005 database connectionstring)I have to add another report which is based on XML data. To do so, I created a new shared datasource, designed my query, added the report parameters, tested the query... This works but when I try to deploy this report on the report server I am getting an error I do not understand:"Attemps to use an "XML" extension of data that has not been registered for this report server"I do...
XML datetime in format '2001-12-17T09:30:47-05:00'Hi there,
i must create some xml with datetimes in it. It has to be of
the format '2001-12-17T09:30:47-05:00'. I don't find how to
do this. I've made expressions on my datetime but it has no
effect on the result in XML. How do i even get the timezone
information in it?
Am i missing something or do i need to convert the datetimes
to string and make the string manually?
Many thanks,
DS.
DS wrote:
> Hi there,
>
> i must create some xml with datetimes in it. It has to be of
> the format '2001-12-17T09:30:47-05:00'. I don't find how ...
Error: invalid format "XML"Hi,
I am trying to output a result set to XML format. The documentation says
it works something like this : Output to c:\test.xml Format XML
I try this but I get an Error : ***Error: invalid format "XML"
Am I doing something wrong?
Thanks,
Veselin
Veselin,
are you using the DBISQLC utility?
AFAIK, this legacy C-based tool does not support the "newer" output formats
like XML.
If so, then you will have to use the Java-based DBISQL.
HTH
Volker
"Veselin Ivanov" <vs@sonita.com> wrote innews:4936294f$1@forums-1-dub...
> Hi,
&...
"XML page cannot be displayed" added to XML Download
I'm using these lines to initiae a download of an xml file.
Response.Clear()Response.ContentType = "application/octet-stream"Response.AddHeader("Content-Disposition", _"attachment; filename=""" & varFileName & """")Response.Flush()Response.WriteFile(varFileName)
File looks fine in XML viewer just after created.
But the output of the download, when viewed as XML, has the following, fully formatted http error imbedded in it:
XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh butto...