HighTechTalks DotNet Forums  

2nd Post - {0:c} causes deletes to fail!

ASP.net Data Grid Control microsoft.public.dotnet.framework.aspnet.datagridcontrol


Discuss 2nd Post - {0:c} causes deletes to fail! in the ASP.net Data Grid Control forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Scott M.
 
Posts: n/a

Default 2nd Post - {0:c} causes deletes to fail! - 11-27-2007 , 09:11 AM






I didn't get an answer on this the first time around, so I'll try again:
=====================================
I've seen many posts complaining about this, but none with a solution.....

I have a GridView that is bound to a SQLDataSource and working just fine,
except that when I change the DataFormatString on one of my columns that is
displaying a smallmoney value from SQL (converted to double by .NET
Framework) to {0:c}, I get an Input String Was Not In Correct Format
exception when I attempt to delete a record. Editing works just fine.

I know that the problem is that when the delete takes place, the field data
displayed in the GridView contains something like $299.95, which is clearly
not a double and not the same as the orginal value gotten from the
datasource (even if the Input String Was Not In The Correct Format exception
didn't occur, the DELETE command wouldn't delete the record becuase the
displayed data doesn't match the orginial data).

How do I fix this so that when the delete takes place, the data is back in
it's original (unformatted) form. I've tried stripping the "$" and the ","
out of the value in the RowDeleting event handler to no avail.

I've encountered a similar problem with another field I'm pulling from the
datasource. It's a path to an image (string data). The path needs a little
adjustment to make it correct for a given application's location and so
simple concatenation is done to the custom databinding expression to make
the path correct and be able to show the data as an actual image, rather
than as a string. That all works fine, but now the underlying field data is
again different than the original data in the database, so deleting this
record doesn't cause an error, it just doesn't actaully do the delete.

Any ideas how I can format my GridView data displayed without sacraficing my
ability to modify the underlying data?


Reply With Quote
  #2  
Old   
Steven Cheng[MSFT]
 
Posts: n/a

Default RE: 2nd Post - {0:c} causes deletes to fail! - 11-28-2007 , 12:37 AM






Hi Scott,

For the problem, in the previous thread, as I didn't get the same gridview
display, I think it maybe caused by the culture setting which control the
currency formatting. To make the simplify the test, would you send me a
simple web project(with a page and a test SQL Express DB) that can repro
it? You can send it to me through the following address:

"stcheng" + "@" + "microsoft.com";

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
Quote:
Reply-To: "Scott M." <smar (AT) nospam (DOT) nospam
From: "Scott M." <smar (AT) nospam (DOT) nospam
Subject: 2nd Post - {0:c} causes deletes to fail!
Date: Tue, 27 Nov 2007 10:11:13 -0500

I didn't get an answer on this the first time around, so I'll try again:
=====================================
I've seen many posts complaining about this, but none with a solution.....

I have a GridView that is bound to a SQLDataSource and working just fine,
except that when I change the DataFormatString on one of my columns that is
displaying a smallmoney value from SQL (converted to double by .NET
Framework) to {0:c}, I get an Input String Was Not In Correct Format
exception when I attempt to delete a record. Editing works just fine.

I know that the problem is that when the delete takes place, the field
data
displayed in the GridView contains something like $299.95, which is
clearly
not a double and not the same as the orginal value gotten from the
datasource (even if the Input String Was Not In The Correct Format
exception
didn't occur, the DELETE command wouldn't delete the record becuase the
displayed data doesn't match the orginial data).

How do I fix this so that when the delete takes place, the data is back in
it's original (unformatted) form. I've tried stripping the "$" and the
","
out of the value in the RowDeleting event handler to no avail.

I've encountered a similar problem with another field I'm pulling from the
datasource. It's a path to an image (string data). The path needs a
little
adjustment to make it correct for a given application's location and so
simple concatenation is done to the custom databinding expression to make
the path correct and be able to show the data as an actual image, rather
than as a string. That all works fine, but now the underlying field data
is
again different than the original data in the database, so deleting this
record doesn't cause an error, it just doesn't actaully do the delete.

Any ideas how I can format my GridView data displayed without sacraficing
my
ability to modify the underlying data?




Reply With Quote
  #3  
Old   
Scott M.
 
Posts: n/a

Default Re: 2nd Post - {0:c} causes deletes to fail! - 11-28-2007 , 04:16 PM



Ok Steven,

Give me a little time to put it together and I'll get it off to you.

Thanks.

"Steven Cheng[MSFT]" <stcheng (AT) online (DOT) microsoft.com> wrote

Quote:
Hi Scott,

For the problem, in the previous thread, as I didn't get the same gridview
display, I think it maybe caused by the culture setting which control the
currency formatting. To make the simplify the test, would you send me a
simple web project(with a page and a test SQL Express DB) that can repro
it? You can send it to me through the following address:

"stcheng" + "@" + "microsoft.com";

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no
rights.

--------------------
Reply-To: "Scott M." <smar (AT) nospam (DOT) nospam
From: "Scott M." <smar (AT) nospam (DOT) nospam
Subject: 2nd Post - {0:c} causes deletes to fail!
Date: Tue, 27 Nov 2007 10:11:13 -0500

I didn't get an answer on this the first time around, so I'll try again:
=====================================
I've seen many posts complaining about this, but none with a solution.....

I have a GridView that is bound to a SQLDataSource and working just fine,
except that when I change the DataFormatString on one of my columns that
is
displaying a smallmoney value from SQL (converted to double by .NET
Framework) to {0:c}, I get an Input String Was Not In Correct Format
exception when I attempt to delete a record. Editing works just fine.

I know that the problem is that when the delete takes place, the field
data
displayed in the GridView contains something like $299.95, which is
clearly
not a double and not the same as the orginal value gotten from the
datasource (even if the Input String Was Not In The Correct Format
exception
didn't occur, the DELETE command wouldn't delete the record becuase the
displayed data doesn't match the orginial data).

How do I fix this so that when the delete takes place, the data is back in
it's original (unformatted) form. I've tried stripping the "$" and the
","
out of the value in the RowDeleting event handler to no avail.

I've encountered a similar problem with another field I'm pulling from the
datasource. It's a path to an image (string data). The path needs a
little
adjustment to make it correct for a given application's location and so
simple concatenation is done to the custom databinding expression to make
the path correct and be able to show the data as an actual image, rather
than as a string. That all works fine, but now the underlying field data
is
again different than the original data in the database, so deleting this
record doesn't cause an error, it just doesn't actaully do the delete.

Any ideas how I can format my GridView data displayed without sacraficing
my
ability to modify the underlying data?






Reply With Quote
  #4  
Old   
Steven Cheng[MSFT]
 
Posts: n/a

Default Re: 2nd Post - {0:c} causes deletes to fail! - 12-02-2007 , 09:09 PM



Hi Scott,

Any progress on this? If you're busy on some other work currently, feel
free to followup at your convenience. I'll keep monitoring here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
Quote:
From: "Scott M." <smar (AT) nospam (DOT) nospam
References: <A15E4C9B-A479-4C0D-8D92-1B7C6C4A38F9 (AT) microsoft (DOT) com
NimBqkYMIHA.4200 (AT) TK2MSFTNGHUB02 (DOT) phx.gbl
Subject: Re: 2nd Post - {0:c} causes deletes to fail!
Date: Wed, 28 Nov 2007 17:16:29 -0500

Ok Steven,

Give me a little time to put it together and I'll get it off to you.

Thanks.

"Steven Cheng[MSFT]" <stcheng (AT) online (DOT) microsoft.com> wrote in message
news:NimBqkYMIHA.4200 (AT) TK2MSFTNGHUB02 (DOT) phx.gbl...
Hi Scott,

For the problem, in the previous thread, as I didn't get the same
gridview
display, I think it maybe caused by the culture setting which control the
currency formatting. To make the simplify the test, would you send me a
simple web project(with a page and a test SQL Express DB) that can repro
it? You can send it to me through the following address:

"stcheng" + "@" + "microsoft.com";

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no
rights.

--------------------
Reply-To: "Scott M." <smar (AT) nospam (DOT) nospam
From: "Scott M." <smar (AT) nospam (DOT) nospam
Subject: 2nd Post - {0:c} causes deletes to fail!
Date: Tue, 27 Nov 2007 10:11:13 -0500

I didn't get an answer on this the first time around, so I'll try again:
=====================================
I've seen many posts complaining about this, but none with a
solution.....

I have a GridView that is bound to a SQLDataSource and working just fine,
except that when I change the DataFormatString on one of my columns that
is
displaying a smallmoney value from SQL (converted to double by .NET
Framework) to {0:c}, I get an Input String Was Not In Correct Format
exception when I attempt to delete a record. Editing works just fine.

I know that the problem is that when the delete takes place, the field
data
displayed in the GridView contains something like $299.95, which is
clearly
not a double and not the same as the orginal value gotten from the
datasource (even if the Input String Was Not In The Correct Format
exception
didn't occur, the DELETE command wouldn't delete the record becuase the
displayed data doesn't match the orginial data).

How do I fix this so that when the delete takes place, the data is back
in
it's original (unformatted) form. I've tried stripping the "$" and the
","
out of the value in the RowDeleting event handler to no avail.

I've encountered a similar problem with another field I'm pulling from
the
datasource. It's a path to an image (string data). The path needs a
little
adjustment to make it correct for a given application's location and so
simple concatenation is done to the custom databinding expression to make
the path correct and be able to show the data as an actual image, rather
than as a string. That all works fine, but now the underlying field data
is
again different than the original data in the database, so deleting this
record doesn't cause an error, it just doesn't actaully do the delete.

Any ideas how I can format my GridView data displayed without sacraficing
my
ability to modify the underlying data?








Reply With Quote
  #5  
Old   
Scott M.
 
Posts: n/a

Default Re: 2nd Post - {0:c} causes deletes to fail! - 12-03-2007 , 06:47 PM



Hi Steven,

Yes, I'm still busy but haven't fogotten about this. I am very interested
in figuring this out. I'll post back when I can.

Thanks,

Scott

"Steven Cheng[MSFT]" <stcheng (AT) online (DOT) microsoft.com> wrote

Quote:
Hi Scott,

Any progress on this? If you're busy on some other work currently, feel
free to followup at your convenience. I'll keep monitoring here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no
rights.

--------------------
From: "Scott M." <smar (AT) nospam (DOT) nospam
References: <A15E4C9B-A479-4C0D-8D92-1B7C6C4A38F9 (AT) microsoft (DOT) com
NimBqkYMIHA.4200 (AT) TK2MSFTNGHUB02 (DOT) phx.gbl
Subject: Re: 2nd Post - {0:c} causes deletes to fail!
Date: Wed, 28 Nov 2007 17:16:29 -0500

Ok Steven,

Give me a little time to put it together and I'll get it off to you.

Thanks.

"Steven Cheng[MSFT]" <stcheng (AT) online (DOT) microsoft.com> wrote in message
news:NimBqkYMIHA.4200 (AT) TK2MSFTNGHUB02 (DOT) phx.gbl...
Hi Scott,

For the problem, in the previous thread, as I didn't get the same
gridview
display, I think it maybe caused by the culture setting which control
the
currency formatting. To make the simplify the test, would you send me a
simple web project(with a page and a test SQL Express DB) that can repro
it? You can send it to me through the following address:

"stcheng" + "@" + "microsoft.com";

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no
rights.

--------------------
Reply-To: "Scott M." <smar (AT) nospam (DOT) nospam
From: "Scott M." <smar (AT) nospam (DOT) nospam
Subject: 2nd Post - {0:c} causes deletes to fail!
Date: Tue, 27 Nov 2007 10:11:13 -0500

I didn't get an answer on this the first time around, so I'll try again:
=====================================
I've seen many posts complaining about this, but none with a
solution.....

I have a GridView that is bound to a SQLDataSource and working just
fine,
except that when I change the DataFormatString on one of my columns that
is
displaying a smallmoney value from SQL (converted to double by .NET
Framework) to {0:c}, I get an Input String Was Not In Correct Format
exception when I attempt to delete a record. Editing works just fine.

I know that the problem is that when the delete takes place, the field
data
displayed in the GridView contains something like $299.95, which is
clearly
not a double and not the same as the orginal value gotten from the
datasource (even if the Input String Was Not In The Correct Format
exception
didn't occur, the DELETE command wouldn't delete the record becuase the
displayed data doesn't match the orginial data).

How do I fix this so that when the delete takes place, the data is back
in
it's original (unformatted) form. I've tried stripping the "$" and the
","
out of the value in the RowDeleting event handler to no avail.

I've encountered a similar problem with another field I'm pulling from
the
datasource. It's a path to an image (string data). The path needs a
little
adjustment to make it correct for a given application's location and so
simple concatenation is done to the custom databinding expression to
make
the path correct and be able to show the data as an actual image, rather
than as a string. That all works fine, but now the underlying field
data
is
again different than the original data in the database, so deleting this
record doesn't cause an error, it just doesn't actaully do the delete.

Any ideas how I can format my GridView data displayed without
sacraficing
my
ability to modify the underlying data?










Reply With Quote
  #6  
Old   
Steven Cheng[MSFT]
 
Posts: n/a

Default Re: 2nd Post - {0:c} causes deletes to fail! - 12-04-2007 , 01:08 AM



Got it! Nice to hear from you. Feel free to take care of your first
priority work

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
Quote:
From: "Scott M." <smar (AT) nospam (DOT) nospam
References: <A15E4C9B-A479-4C0D-8D92-1B7C6C4A38F9 (AT) microsoft (DOT) com
NimBqkYMIHA.4200 (AT) TK2MSFTNGHUB02 (DOT) phx.gbl
<utgxRwgMIHA.3916 (AT) TK2MSFTNGP02 (DOT) phx.gbl>
<J4zAmnVNIHA.7908 (AT) TK2MSFTNGHUB02 (DOT) phx.gbl>
Quote:
Subject: Re: 2nd Post - {0:c} causes deletes to fail!
Date: Mon, 3 Dec 2007 19:47:39 -0500


Hi Steven,

Yes, I'm still busy but haven't fogotten about this. I am very interested
in figuring this out. I'll post back when I can.

Thanks,

Scott

"Steven Cheng[MSFT]" <stcheng (AT) online (DOT) microsoft.com> wrote in message
news:J4zAmnVNIHA.7908 (AT) TK2MSFTNGHUB02 (DOT) phx.gbl...
Hi Scott,

Any progress on this? If you're busy on some other work currently, feel
free to followup at your convenience. I'll keep monitoring here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no
rights.

--------------------
From: "Scott M." <smar (AT) nospam (DOT) nospam
References: <A15E4C9B-A479-4C0D-8D92-1B7C6C4A38F9 (AT) microsoft (DOT) com
NimBqkYMIHA.4200 (AT) TK2MSFTNGHUB02 (DOT) phx.gbl
Subject: Re: 2nd Post - {0:c} causes deletes to fail!
Date: Wed, 28 Nov 2007 17:16:29 -0500

Ok Steven,

Give me a little time to put it together and I'll get it off to you.

Thanks.

"Steven Cheng[MSFT]" <stcheng (AT) online (DOT) microsoft.com> wrote in message
news:NimBqkYMIHA.4200 (AT) TK2MSFTNGHUB02 (DOT) phx.gbl...
Hi Scott,

For the problem, in the previous thread, as I didn't get the same
gridview
display, I think it maybe caused by the culture setting which control
the
currency formatting. To make the simplify the test, would you send me a
simple web project(with a page and a test SQL Express DB) that can
repro
it? You can send it to me through the following address:

"stcheng" + "@" + "microsoft.com";

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no
rights.

--------------------
Reply-To: "Scott M." <smar (AT) nospam (DOT) nospam
From: "Scott M." <smar (AT) nospam (DOT) nospam
Subject: 2nd Post - {0:c} causes deletes to fail!
Date: Tue, 27 Nov 2007 10:11:13 -0500

I didn't get an answer on this the first time around, so I'll try
again:
=====================================
I've seen many posts complaining about this, but none with a
solution.....

I have a GridView that is bound to a SQLDataSource and working just
fine,
except that when I change the DataFormatString on one of my columns
that
is
displaying a smallmoney value from SQL (converted to double by .NET
Framework) to {0:c}, I get an Input String Was Not In Correct Format
exception when I attempt to delete a record. Editing works just fine.

I know that the problem is that when the delete takes place, the field
data
displayed in the GridView contains something like $299.95, which is
clearly
not a double and not the same as the orginal value gotten from the
datasource (even if the Input String Was Not In The Correct Format
exception
didn't occur, the DELETE command wouldn't delete the record becuase the
displayed data doesn't match the orginial data).

How do I fix this so that when the delete takes place, the data is back
in
it's original (unformatted) form. I've tried stripping the "$" and the
","
out of the value in the RowDeleting event handler to no avail.

I've encountered a similar problem with another field I'm pulling from
the
datasource. It's a path to an image (string data). The path needs a
little
adjustment to make it correct for a given application's location and so
simple concatenation is done to the custom databinding expression to
make
the path correct and be able to show the data as an actual image,
rather
than as a string. That all works fine, but now the underlying field
data
is
again different than the original data in the database, so deleting
this
record doesn't cause an error, it just doesn't actaully do the delete.

Any ideas how I can format my GridView data displayed without
sacraficing
my
ability to modify the underlying data?












Reply With Quote
  #7  
Old   
Joe T
 
Posts: n/a

Default Re: 2nd Post - {0:c} causes deletes to fail! - 12-09-2007 , 11:39 AM



Hello,

Had this same issue. Change your delete parameter to string from decimal in
your sqldatasource and it should work.

Joe T

"Steven Cheng[MSFT]" wrote:

Quote:
Got it! Nice to hear from you. Feel free to take care of your first
priority work

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
From: "Scott M." <smar (AT) nospam (DOT) nospam
References: <A15E4C9B-A479-4C0D-8D92-1B7C6C4A38F9 (AT) microsoft (DOT) com
NimBqkYMIHA.4200 (AT) TK2MSFTNGHUB02 (DOT) phx.gbl
utgxRwgMIHA.3916 (AT) TK2MSFTNGP02 (DOT) phx.gbl
J4zAmnVNIHA.7908 (AT) TK2MSFTNGHUB02 (DOT) phx.gbl
Subject: Re: 2nd Post - {0:c} causes deletes to fail!
Date: Mon, 3 Dec 2007 19:47:39 -0500


Hi Steven,

Yes, I'm still busy but haven't fogotten about this. I am very interested
in figuring this out. I'll post back when I can.

Thanks,

Scott

"Steven Cheng[MSFT]" <stcheng (AT) online (DOT) microsoft.com> wrote in message
news:J4zAmnVNIHA.7908 (AT) TK2MSFTNGHUB02 (DOT) phx.gbl...
Hi Scott,

Any progress on this? If you're busy on some other work currently, feel
free to followup at your convenience. I'll keep monitoring here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no
rights.

--------------------
From: "Scott M." <smar (AT) nospam (DOT) nospam
References: <A15E4C9B-A479-4C0D-8D92-1B7C6C4A38F9 (AT) microsoft (DOT) com
NimBqkYMIHA.4200 (AT) TK2MSFTNGHUB02 (DOT) phx.gbl
Subject: Re: 2nd Post - {0:c} causes deletes to fail!
Date: Wed, 28 Nov 2007 17:16:29 -0500

Ok Steven,

Give me a little time to put it together and I'll get it off to you.

Thanks.

"Steven Cheng[MSFT]" <stcheng (AT) online (DOT) microsoft.com> wrote in message
news:NimBqkYMIHA.4200 (AT) TK2MSFTNGHUB02 (DOT) phx.gbl...
Hi Scott,

For the problem, in the previous thread, as I didn't get the same
gridview
display, I think it maybe caused by the culture setting which control
the
currency formatting. To make the simplify the test, would you send me a
simple web project(with a page and a test SQL Express DB) that can
repro
it? You can send it to me through the following address:

"stcheng" + "@" + "microsoft.com";

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no
rights.

--------------------
Reply-To: "Scott M." <smar (AT) nospam (DOT) nospam
From: "Scott M." <smar (AT) nospam (DOT) nospam
Subject: 2nd Post - {0:c} causes deletes to fail!
Date: Tue, 27 Nov 2007 10:11:13 -0500

I didn't get an answer on this the first time around, so I'll try
again:
=====================================
I've seen many posts complaining about this, but none with a
solution.....

I have a GridView that is bound to a SQLDataSource and working just
fine,
except that when I change the DataFormatString on one of my columns
that
is
displaying a smallmoney value from SQL (converted to double by .NET
Framework) to {0:c}, I get an Input String Was Not In Correct Format
exception when I attempt to delete a record. Editing works just fine.

I know that the problem is that when the delete takes place, the field
data
displayed in the GridView contains something like $299.95, which is
clearly
not a double and not the same as the orginal value gotten from the
datasource (even if the Input String Was Not In The Correct Format
exception
didn't occur, the DELETE command wouldn't delete the record becuase the
displayed data doesn't match the orginial data).

How do I fix this so that when the delete takes place, the data is back
in
it's original (unformatted) form. I've tried stripping the "$" and the
","
out of the value in the RowDeleting event handler to no avail.

I've encountered a similar problem with another field I'm pulling from
the
datasource. It's a path to an image (string data). The path needs a
little
adjustment to make it correct for a given application's location and so
simple concatenation is done to the custom databinding expression to
make
the path correct and be able to show the data as an actual image,
rather
than as a string. That all works fine, but now the underlying field
data
is
again different than the original data in the database, so deleting
this
record doesn't cause an error, it just doesn't actaully do the delete.

Any ideas how I can format my GridView data displayed without
sacraficing
my
ability to modify the underlying data?













Reply With Quote
  #8  
Old   
Scott M.
 
Posts: n/a

Default Re: 2nd Post - {0:c} causes deletes to fail! - 12-09-2007 , 11:55 AM



I'll try it Joe. Thanks!



"Joe T" <JoeT (AT) discussions (DOT) microsoft.com> wrote

Quote:
Hello,

Had this same issue. Change your delete parameter to string from decimal
in
your sqldatasource and it should work.

Joe T

"Steven Cheng[MSFT]" wrote:

Got it! Nice to hear from you. Feel free to take care of your first
priority work

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no
rights.


--------------------
From: "Scott M." <smar (AT) nospam (DOT) nospam
References: <A15E4C9B-A479-4C0D-8D92-1B7C6C4A38F9 (AT) microsoft (DOT) com
NimBqkYMIHA.4200 (AT) TK2MSFTNGHUB02 (DOT) phx.gbl
utgxRwgMIHA.3916 (AT) TK2MSFTNGP02 (DOT) phx.gbl
J4zAmnVNIHA.7908 (AT) TK2MSFTNGHUB02 (DOT) phx.gbl
Subject: Re: 2nd Post - {0:c} causes deletes to fail!
Date: Mon, 3 Dec 2007 19:47:39 -0500


Hi Steven,

Yes, I'm still busy but haven't fogotten about this. I am very
interested
in figuring this out. I'll post back when I can.

Thanks,

Scott

"Steven Cheng[MSFT]" <stcheng (AT) online (DOT) microsoft.com> wrote in message
news:J4zAmnVNIHA.7908 (AT) TK2MSFTNGHUB02 (DOT) phx.gbl...
Hi Scott,

Any progress on this? If you're busy on some other work currently,
feel
free to followup at your convenience. I'll keep monitoring here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no
rights.

--------------------
From: "Scott M." <smar (AT) nospam (DOT) nospam
References: <A15E4C9B-A479-4C0D-8D92-1B7C6C4A38F9 (AT) microsoft (DOT) com
NimBqkYMIHA.4200 (AT) TK2MSFTNGHUB02 (DOT) phx.gbl
Subject: Re: 2nd Post - {0:c} causes deletes to fail!
Date: Wed, 28 Nov 2007 17:16:29 -0500

Ok Steven,

Give me a little time to put it together and I'll get it off to you.

Thanks.

"Steven Cheng[MSFT]" <stcheng (AT) online (DOT) microsoft.com> wrote in message
news:NimBqkYMIHA.4200 (AT) TK2MSFTNGHUB02 (DOT) phx.gbl...
Hi Scott,

For the problem, in the previous thread, as I didn't get the same
gridview
display, I think it maybe caused by the culture setting which
control
the
currency formatting. To make the simplify the test, would you send
me a
simple web project(with a page and a test SQL Express DB) that can
repro
it? You can send it to me through the following address:

"stcheng" + "@" + "microsoft.com";

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no
rights.

--------------------
Reply-To: "Scott M." <smar (AT) nospam (DOT) nospam
From: "Scott M." <smar (AT) nospam (DOT) nospam
Subject: 2nd Post - {0:c} causes deletes to fail!
Date: Tue, 27 Nov 2007 10:11:13 -0500

I didn't get an answer on this the first time around, so I'll try
again:
=====================================
I've seen many posts complaining about this, but none with a
solution.....

I have a GridView that is bound to a SQLDataSource and working just
fine,
except that when I change the DataFormatString on one of my columns
that
is
displaying a smallmoney value from SQL (converted to double by .NET
Framework) to {0:c}, I get an Input String Was Not In Correct Format
exception when I attempt to delete a record. Editing works just
fine.

I know that the problem is that when the delete takes place, the
field
data
displayed in the GridView contains something like $299.95, which is
clearly
not a double and not the same as the orginal value gotten from the
datasource (even if the Input String Was Not In The Correct Format
exception
didn't occur, the DELETE command wouldn't delete the record becuase
the
displayed data doesn't match the orginial data).

How do I fix this so that when the delete takes place, the data is
back
in
it's original (unformatted) form. I've tried stripping the "$" and
the
","
out of the value in the RowDeleting event handler to no avail.

I've encountered a similar problem with another field I'm pulling
from
the
datasource. It's a path to an image (string data). The path needs
a
little
adjustment to make it correct for a given application's location and
so
simple concatenation is done to the custom databinding expression to
make
the path correct and be able to show the data as an actual image,
rather
than as a string. That all works fine, but now the underlying field
data
is
again different than the original data in the database, so deleting
this
record doesn't cause an error, it just doesn't actaully do the
delete.

Any ideas how I can format my GridView data displayed without
sacraficing
my
ability to modify the underlying data?















Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.