Gridview change from B2 =>RC1

S

Steven Molen

All my delete functionality has broken since I have upgraded to RC1.

In beta 2 when deleting a record, the gridview would only pass
"Original_Record_Id" to the table adapter delete method.

Now it passes both the "original_record_id" AND "record_id" to the delete
method royally screwing all my code...

Is there a way to turn off this functionality??? I could have lived with the
"original_xxx" but why must both be passed now especially for delete methods
where the record_id has not changed (because its a pk).
 
S

Steven Cheng[MSFT]

Hi Steven,

Welcome to ASPNET newsgroup.
Regarding on the GridView item deleting/updating changes from beta2 to RC1
problem, are you using the TableAdapter together with ObjectDataSource
control? If so, have you tried rebind the ObjectDataSource to the GridView
and refresh the schema to see whether you can get it work?

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| Thread-Topic: Gridview change from B2 =>RC1
| thread-index: AcXOcuzFhlv11w8tSludE3zK/PA8ig==
| X-WBNR-Posting-Host: 205.235.104.4
| From: =?Utf-8?B?U3RldmVuIE1vbGVu?= <[email protected]>
| References: <[email protected]>
| Subject: RE: Gridview change from B2 =>RC1
| Date: Tue, 11 Oct 2005 07:49:04 -0700
| Lines: 15
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet.webcontrols:30567
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
|
| Updates are also the same way.
|
| "Steven Molen" wrote:
|
| > All my delete functionality has broken since I have upgraded to RC1.
| >
| > In beta 2 when deleting a record, the gridview would only pass
| > "Original_Record_Id" to the table adapter delete method.
| >
| > Now it passes both the "original_record_id" AND "record_id" to the
delete
| > method royally screwing all my code...
| >
| > Is there a way to turn off this functionality??? I could have lived
with the
| > "original_xxx" but why must both be passed now especially for delete
methods
| > where the record_id has not changed (because its a pk).
|
 
S

Steven Molen

It has nothing to do with binding. the objectdatasource and the gridview bind
just find.

The issue comes up when the gridview tries to call the update or delete
methods of the objectdatasource. The ObjectDataSource is essentially a thin
veneer for a sproc that only accepts "original_record_id", in the case of
deletes, or "original_record_id" and the changed values in the case of
updates.

These methods worked appropriately in Beta2.

Here is the error I am now getting in RC1.

System.InvalidOperationException: ObjectDataSource 'RecordDataSource' could
not find a non-generic method 'Delete' that has parameters:
Original_Record_ID, Record_ID.\r\n at
System.Web.UI.WebControls.ObjectDataSourceView.GetResolvedMethodData(Type
type, String methodName, IDictionary allParameters, DataSourceOperation
operation)\r\n at
System.Web.UI.WebControls.ObjectDataSourceView.ExecuteDelete(IDictionary
keys, IDictionary oldValues)\r\n at
System.Web.UI.DataSourceView.Delete(IDictionary keys, IDictionary oldValues,
DataSourceViewOperationCallback callback)

To make a long story short:

*Beta2 only passed "Original_Record_ID" as a parameter when doing update or
deletes.

*RC1 now passes both "Original_Record_ID" AND "Record_ID" as parameters when
doing update or deletes. (which is absolutely assinine when the ID parameter
is a pk IMHO).

Any way to modify this functionality??? Or is this working as intended now
and I just need to modify all my stuff to make it work?
 
S

Steven Cheng[MSFT]

Hi steven,

After some further testing, comparing the pages which work in RC with the
original one built in beta2, I found the cause of the problem is at the
DataSource control, in BETA2, we don't need to explicitly declare the
OldValuesParameterFormatString£¬ however in RC version, we need to
explicitly add this in the Datasource control like:

OldValuesParameterFormatString="original_{0}"

So our ObjectDataSource's declartion will be something like:
======================
<asp bjectDataSource ID="ObjectDataSource1" runat="server"
OldValuesParameterFormatString="original_{0}" ....................
======================

Hope helps. Thanks,

Steven Cheng
Microsoft Online Support

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

--------------------
| Thread-Topic: Gridview change from B2 =>RC1
| thread-index: AcXPJ2oH3WV3qh8LRe6qtMIgwM5qng==
| X-WBNR-Posting-Host: 205.235.104.4
| From: =?Utf-8?B?U3RldmVuIE1vbGVu?= <[email protected]>
| References: <[email protected]>
<[email protected]>
<[email protected]>
| Subject: RE: Gridview change from B2 =>RC1
| Date: Wed, 12 Oct 2005 05:21:03 -0700
| Lines: 101
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet.webcontrols:30584
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
|
| It has nothing to do with binding. the objectdatasource and the gridview
bind
| just find.
|
| The issue comes up when the gridview tries to call the update or delete
| methods of the objectdatasource. The ObjectDataSource is essentially a
thin
| veneer for a sproc that only accepts "original_record_id", in the case of
| deletes, or "original_record_id" and the changed values in the case of
| updates.
|
| These methods worked appropriately in Beta2.
|
| Here is the error I am now getting in RC1.
|
| System.InvalidOperationException: ObjectDataSource 'RecordDataSource'
could
| not find a non-generic method 'Delete' that has parameters:
| Original_Record_ID, Record_ID.\r\n at
| System.Web.UI.WebControls.ObjectDataSourceView.GetResolvedMethodData(Type
| type, String methodName, IDictionary allParameters, DataSourceOperation
| operation)\r\n at
| System.Web.UI.WebControls.ObjectDataSourceView.ExecuteDelete(IDictionary
| keys, IDictionary oldValues)\r\n at
| System.Web.UI.DataSourceView.Delete(IDictionary keys, IDictionary
oldValues,
| DataSourceViewOperationCallback callback)
|
| To make a long story short:
|
| *Beta2 only passed "Original_Record_ID" as a parameter when doing update
or
| deletes.
|
| *RC1 now passes both "Original_Record_ID" AND "Record_ID" as parameters
when
| doing update or deletes. (which is absolutely assinine when the ID
parameter
| is a pk IMHO).
|
| Any way to modify this functionality??? Or is this working as intended
now
| and I just need to modify all my stuff to make it work?
|
| "Steven Cheng[MSFT]" wrote:
|
| > Hi Steven,
| >
| > Welcome to ASPNET newsgroup.
| > Regarding on the GridView item deleting/updating changes from beta2 to
RC1
| > problem, are you using the TableAdapter together with ObjectDataSource
| > control? If so, have you tried rebind the ObjectDataSource to the
GridView
| > and refresh the schema to see whether you can get it work?
| >
| > Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure! www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| > --------------------
| > | Thread-Topic: Gridview change from B2 =>RC1
| > | thread-index: AcXOcuzFhlv11w8tSludE3zK/PA8ig==
| > | X-WBNR-Posting-Host: 205.235.104.4
| > | From: =?Utf-8?B?U3RldmVuIE1vbGVu?= <[email protected]>
| > | References: <[email protected]>
| > | Subject: RE: Gridview change from B2 =>RC1
| > | Date: Tue, 11 Oct 2005 07:49:04 -0700
| > | Lines: 15
| > | Message-ID: <[email protected]>
| > | MIME-Version: 1.0
| > | Content-Type: text/plain;
| > | charset="Utf-8"
| > | Content-Transfer-Encoding: 7bit
| > | X-Newsreader: Microsoft CDO for Windows 2000
| > | Content-Class: urn:content-classes:message
| > | Importance: normal
| > | Priority: normal
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| > | Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| > | Xref: TK2MSFTNGXA02.phx.gbl
| > microsoft.public.dotnet.framework.aspnet.webcontrols:30567
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
| > |
| > | Updates are also the same way.
| > |
| > | "Steven Molen" wrote:
| > |
| > | > All my delete functionality has broken since I have upgraded to RC1.
| > | >
| > | > In beta 2 when deleting a record, the gridview would only pass
| > | > "Original_Record_Id" to the table adapter delete method.
| > | >
| > | > Now it passes both the "original_record_id" AND "record_id" to the
| > delete
| > | > method royally screwing all my code...
| > | >
| > | > Is there a way to turn off this functionality??? I could have lived
| > with the
| > | > "original_xxx" but why must both be passed now especially for
delete
| > methods
| > | > where the record_id has not changed (because its a pk).
| > |
| >
| >
|
 
S

Steven Cheng[MSFT]

Hi Steven,

Have you tried the suggestion in my last reply or have you got progress on
this issue? If there're anything else we can help, please feel free to post
here. Thanks,

Steven Cheng
Microsoft Online Support

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


--------------------
| X-Tomcat-ID: 148805256
| References: <[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain
| Content-Transfer-Encoding: 7bit
| From: (e-mail address removed) (Steven Cheng[MSFT])
| Organization: Microsoft
| Date: Mon, 17 Oct 2005 09:26:08 GMT
| Subject: RE: Gridview change from B2 =>RC1
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
| Message-ID: <Di#[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| Lines: 158
| Path: TK2MSFTNGXA01.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet.webcontrols:11338
| NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122
|
| Hi steven,
|
| After some further testing, comparing the pages which work in RC with the
| original one built in beta2, I found the cause of the problem is at the
| DataSource control, in BETA2, we don't need to explicitly declare the
| OldValuesParameterFormatString£¬ however in RC version, we need to
| explicitly add this in the Datasource control like:
|
| OldValuesParameterFormatString="original_{0}"
|
| So our ObjectDataSource's declartion will be something like:
| ======================
| <asp bjectDataSource ID="ObjectDataSource1" runat="server"
| OldValuesParameterFormatString="original_{0}" ...............
| >
| ....
| ======================
|
| Hope helps. Thanks,
|
| Steven Cheng
| Microsoft Online Support
|
| Get Secure! www.microsoft.com/security
| (This posting is provided "AS IS", with no warranties, and confers no
| rights.)
|
| --------------------
| | Thread-Topic: Gridview change from B2 =>RC1
| | thread-index: AcXPJ2oH3WV3qh8LRe6qtMIgwM5qng==
| | X-WBNR-Posting-Host: 205.235.104.4
| | From: =?Utf-8?B?U3RldmVuIE1vbGVu?= <[email protected]>
| | References: <[email protected]>
| <[email protected]>
| <[email protected]>
| | Subject: RE: Gridview change from B2 =>RC1
| | Date: Wed, 12 Oct 2005 05:21:03 -0700
| | Lines: 101
| | Message-ID: <[email protected]>
| | MIME-Version: 1.0
| | Content-Type: text/plain;
| | charset="Utf-8"
| | Content-Transfer-Encoding: 7bit
| | X-Newsreader: Microsoft CDO for Windows 2000
| | Content-Class: urn:content-classes:message
| | Importance: normal
| | Priority: normal
| | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| | Xref: TK2MSFTNGXA02.phx.gbl
| microsoft.public.dotnet.framework.aspnet.webcontrols:30584
| | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
| |
| | It has nothing to do with binding. the objectdatasource and the
gridview
| bind
| | just find.
| |
| | The issue comes up when the gridview tries to call the update or delete
| | methods of the objectdatasource. The ObjectDataSource is essentially a
| thin
| | veneer for a sproc that only accepts "original_record_id", in the case
of
| | deletes, or "original_record_id" and the changed values in the case of
| | updates.
| |
| | These methods worked appropriately in Beta2.
| |
| | Here is the error I am now getting in RC1.
| |
| | System.InvalidOperationException: ObjectDataSource 'RecordDataSource'
| could
| | not find a non-generic method 'Delete' that has parameters:
| | Original_Record_ID, Record_ID.\r\n at
| |
System.Web.UI.WebControls.ObjectDataSourceView.GetResolvedMethodData(Type
| | type, String methodName, IDictionary allParameters, DataSourceOperation
| | operation)\r\n at
| |
System.Web.UI.WebControls.ObjectDataSourceView.ExecuteDelete(IDictionary
| | keys, IDictionary oldValues)\r\n at
| | System.Web.UI.DataSourceView.Delete(IDictionary keys, IDictionary
| oldValues,
| | DataSourceViewOperationCallback callback)
| |
| | To make a long story short:
| |
| | *Beta2 only passed "Original_Record_ID" as a parameter when doing
update
| or
| | deletes.
| |
| | *RC1 now passes both "Original_Record_ID" AND "Record_ID" as parameters
| when
| | doing update or deletes. (which is absolutely assinine when the ID
| parameter
| | is a pk IMHO).
| |
| | Any way to modify this functionality??? Or is this working as intended
| now
| | and I just need to modify all my stuff to make it work?
| |
| | "Steven Cheng[MSFT]" wrote:
| |
| | > Hi Steven,
| | >
| | > Welcome to ASPNET newsgroup.
| | > Regarding on the GridView item deleting/updating changes from beta2
to
| RC1
| | > problem, are you using the TableAdapter together with
ObjectDataSource
| | > control? If so, have you tried rebind the ObjectDataSource to the
| GridView
| | > and refresh the schema to see whether you can get it work?
| | >
| | > Thanks,
| | >
| | > Steven Cheng
| | > Microsoft Online Support
| | >
| | > Get Secure! www.microsoft.com/security
| | > (This posting is provided "AS IS", with no warranties, and confers no
| | > rights.)
| | > --------------------
| | > | Thread-Topic: Gridview change from B2 =>RC1
| | > | thread-index: AcXOcuzFhlv11w8tSludE3zK/PA8ig==
| | > | X-WBNR-Posting-Host: 205.235.104.4
| | > | From: =?Utf-8?B?U3RldmVuIE1vbGVu?= <[email protected]>
| | > | References: <[email protected]>
| | > | Subject: RE: Gridview change from B2 =>RC1
| | > | Date: Tue, 11 Oct 2005 07:49:04 -0700
| | > | Lines: 15
| | > | Message-ID: <[email protected]>
| | > | MIME-Version: 1.0
| | > | Content-Type: text/plain;
| | > | charset="Utf-8"
| | > | Content-Transfer-Encoding: 7bit
| | > | X-Newsreader: Microsoft CDO for Windows 2000
| | > | Content-Class: urn:content-classes:message
| | > | Importance: normal
| | > | Priority: normal
| | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| | > | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| | > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| | > | Path:
| TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
| | > | Xref: TK2MSFTNGXA02.phx.gbl
| | > microsoft.public.dotnet.framework.aspnet.webcontrols:30567
| | > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
| | > |
| | > | Updates are also the same way.
| | > |
| | > | "Steven Molen" wrote:
| | > |
| | > | > All my delete functionality has broken since I have upgraded to
RC1.
| | > | >
| | > | > In beta 2 when deleting a record, the gridview would only pass
| | > | > "Original_Record_Id" to the table adapter delete method.
| | > | >
| | > | > Now it passes both the "original_record_id" AND "record_id" to
the
| | > delete
| | > | > method royally screwing all my code...
| | > | >
| | > | > Is there a way to turn off this functionality??? I could have
lived
| | > with the
| | > | > "original_xxx" but why must both be passed now especially for
| delete
| | > methods
| | > | > where the record_id has not changed (because its a pk).
| | > |
| | >
| | >
| |
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,142
Messages
2,570,818
Members
47,362
Latest member
eitamoro

Latest Threads

Top