PC Review


Reply
Thread Tools Rate Thread

DetailsView updates unused properties to null

 
 
Nick Bennett
Guest
Posts: n/a
 
      20th Jan 2008
I've got a page with a DetailsView. It uses a SqlDataSource which itself
uses stored procedures for Select and Update.

I don't want the user to see some of the columns, but if I don't bind them
(or if I do bind them but set Visible=False), when the Update procedure is
called, the parameters corresponding to the columns that weren't bound to
the DetailsView are all null.

This can't be an uncommon scenario, so I guess I have missed something. Any
ideas?


 
Reply With Quote
 
 
 
 
Milosz Skalecki [MCAD]
Guest
Posts: n/a
 
      20th Jan 2008
Howdy,

Take a look at BoundField's InsertVisible property as well as SqlDataSource
Updating/Inserting events.

Regards
--
Milosz


"Nick Bennett" wrote:

> I've got a page with a DetailsView. It uses a SqlDataSource which itself
> uses stored procedures for Select and Update.
>
> I don't want the user to see some of the columns, but if I don't bind them
> (or if I do bind them but set Visible=False), when the Update procedure is
> called, the parameters corresponding to the columns that weren't bound to
> the DetailsView are all null.
>
> This can't be an uncommon scenario, so I guess I have missed something. Any
> ideas?
>
>
>

 
Reply With Quote
 
Angel
Guest
Posts: n/a
 
      23rd Jan 2008
Using BoundField might help but keep in mind that things get really ugly when
you mix Declarative stuff and code. My suggestion to you is go completely
code replace the sqldatasource with a dataset or datatable and user the
datasource property instead.

Where it get tricky is if you have dropdowns or any other template based
field it can get a little hard to do but is doable I have a demo depicting a
dynamic situation
similar to the one you are describing. Mine involves a detailsview and
Gridview in a master/details relationship. One page hitting multiple table
and columns are defined at runtime.

If you are interested let me know and I will be glad to share this with you.
--
aaa


"Nick Bennett" wrote:

> I've got a page with a DetailsView. It uses a SqlDataSource which itself
> uses stored procedures for Select and Update.
>
> I don't want the user to see some of the columns, but if I don't bind them
> (or if I do bind them but set Visible=False), when the Update procedure is
> called, the parameters corresponding to the columns that weren't bound to
> the DetailsView are all null.
>
> This can't be an uncommon scenario, so I guess I have missed something. Any
> ideas?
>
>
>

 
Reply With Quote
 
Paul Shapiro
Guest
Posts: n/a
 
      11th Feb 2008
You could use a stored procedure which did not include parameters for the
columns you don't want updated.

An asp:Boundfield has a ConvertEmptyStringToNull property. Have you tried
setting that to false?

"Nick Bennett" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I've got a page with a DetailsView. It uses a SqlDataSource which itself
> uses stored procedures for Select and Update.
>
> I don't want the user to see some of the columns, but if I don't bind them
> (or if I do bind them but set Visible=False), when the Update procedure is
> called, the parameters corresponding to the columns that weren't bound to
> the DetailsView are all null.
>
> This can't be an uncommon scenario, so I guess I have missed something.
> Any ideas?


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with checking null or empty value in detailsview bob Microsoft VB .NET 3 5th May 2008 10:46 PM
problem with checking null or empty value in detailsview bob Microsoft ASP .NET 3 5th May 2008 10:46 PM
Force unused formula cells to be null Larry R Microsoft Excel Worksheet Functions 4 7th Feb 2008 01:44 AM
DetailsView - conditional setting of cell or row properties (e.g., read only) K B Microsoft ASP .NET 0 17th Apr 2006 03:24 PM
DetailsView: Change TemplateField properties dynamically (vb) sck10 Microsoft ASP .NET 2 7th Nov 2005 02:07 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:38 AM.