473,396 Members | 1,997 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

delete question

In my grid I"m showing my date as {0:yyyy/M/d}
now my date is the key in the table so i need it to be as it is in the table
to delete
mm/dd/yyyy, How can I reverse the display format so i can delete the row?

i have
dim eDate as string

strSQL = "DELETE from Points where eDate = ' " & eDate & " ' "

I need to make it the correct format to delete
Nov 18 '05 #1
3 932
Hi Mike,

One idea would be to store the original date (unformatted) in another column
but turn off its display. You can still access its value by getting it from
the hidden column.

"Mike" <me@me.com> wrote in message
news:O0**************@TK2MSFTNGP09.phx.gbl...
In my grid I"m showing my date as {0:yyyy/M/d}
now my date is the key in the table so i need it to be as it is in the
table
to delete
mm/dd/yyyy, How can I reverse the display format so i can delete the row?

i have
dim eDate as string

strSQL = "DELETE from Points where eDate = ' " & eDate & " ' "

I need to make it the correct format to delete


Nov 18 '05 #2
Hi Mike,

As for the problem on retrieve back the output date string and format back
to the original format, I think you can try using the DateTime.Parse method
to reconstruct a DateTime instance from a date string such as:
DateTime date1 = DateTime.Parse("2004-5-2");
DateTime date2 = DateTime.Parse("5/2/2004");
DateTime date3 = DateTime.Parse("2004/5/2");

Then, we can get whatever output format of the datetime via its ToString
method, just as:
Response.Write("<br>yyyy/M/d: "+ date.ToString("yyyy/M/d"));
Response.Write("<br>mm/dd/yyyy: " + date.ToString("mm/dd/yyyy"));
Response.Write("<br>yyyy-mm-dd: " + date.ToString("yyyy-mm-dd"));

For more info on the DateTime class 's Parse or ToString format, you can
reference the msdn library:

http://msdn.microsoft.com/library/en...omdatetimeform
atstrings.asp?frame=true

In addition, I also recommend that you consider Ken 's suggetion on use a
hidden column to hold the original Date info. That'll be more convenient.
Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
Nov 18 '05 #3
Hi Mike,

Have you had a chance to check out the suggestions in my last reply or have
you got any further ideas on this issue? If you have anything unclear or if
there're anything else we can help, please feel free to post here. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Matan Nassau | last post by:
Hello. i have a composite which i want to delete. this is a composite which represents a boolean expression (see a previous post of mine with more details at...
16
by: robert | last post by:
been ruminating on the question (mostly in a 390/v7 context) of whether, and if so when, a row update becomes an insert/delete. i assume that there is a threshold on the number of columns of the...
0
by: Suzanne | last post by:
I'd like to know how can I put up a confirmation question when the user tries to delete a row in the datagrid by clicking on the row header and pressing the Delete key? I have found this code on...
1
by: Barry L. Camp | last post by:
Hi all, Wondering if someone can help with a nagging problem I am having using a GridView and an ObjectDataSource. I have a simple situation where I am trying to delete a row from a table, but...
12
by: yufufi | last post by:
Hello, How does delete know how much memory to deallocate from the given pointer? AFAIK this informations is put there by new. new puts the size of the allocated memory before the just before...
10
by: jeffjohnson_alpha | last post by:
We all know that a new-expression, foo* a = new foo() ; allocates memory for a single foo then calls foo::foo(). And we know that void* p = ::operator new(sizeof(foo)) ; allocates a...
15
by: tom | last post by:
why delete the dynamically allocated memory twice causes an error, see the code below: int _tmain(int argc, _TCHAR* argv) { int *pi = new int(12); cout<<*pi; delete pi; delete pi; }
29
by: =?Utf-8?B?R2Vvcmdl?= | last post by:
Hello everyone, I remembered delete is implemented through operator overloading, but I am not quite clear. Could anyone recommend some links about how delete is implemented so that I can...
7
by: subramanian100in | last post by:
The following discussion is for learning purpose only. 1) Suppose for a type T, I have T *ptr = new T; To free ptr, suppose I use ( I deliberately omit in delete.) delete ptr;
18
by: aj | last post by:
I have the following snippet of code. On some platforms, the delete calls works, on Linux, it core dumps (memory dump) at the delete call. Am I responsible for deleting the memory that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.