Gridview Updates not writing to database after clicking update

  • Thread starter Rickey Whitworth
  • Start date
R

Rickey Whitworth

I have a gridview tied to a single table in a sql server database. I have
created an update query on the datasource

UPDATE dbo.PredefinedTasks SET PredefinedTask = @PredefinedTask,
TaskFilterID = @TaskFilterID WHERE (PredefinedTaskID =
@original_PredefinedTaskID)

I have enabled the gridview for editing. When I click edit, i change the
PredefinedTask column and click update. The row returns to an edit row but
the changes I made are not reflected.

I had several gridviews working with Beta 2, but now they are doing the same
change. What am I missing?
 
S

Steven Cheng[MSFT]

Hi Rickey,

Welcome to ASP.NET newsgroup.
From your description, you have a ASP.NET 2.0 page which ues GridView with
edit/update function. Now it broke working after move from beta2
environment to RTM, yes?

I'm not sure about the underlying datasource, are you using the
SqlDataSource control? If so, I suggest you first try reconfigure the
SqlDAtaSource control (regenerate and refresh the schema). After that,
rebind the SqlDataSource control to the GridView (detach the GridView's
DataSource first and attach it with the reconfigured DataSourceControl
again). Then, test the page again to see whether it works. Based on my
experience, there'll occur some small configuration requirement changes. I
suggest you also try comparing the problem GridView's aspx template with
some other working page(new created in RTM environment) to see whether
there is any difference.

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.)




--------------------
| From: "Rickey Whitworth" <[email protected]>
| Subject: Gridview Updates not writing to database after clicking update
| Date: Sun, 6 Nov 2005 19:08:45 -0600
| Lines: 15
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| NNTP-Posting-Host: 66.182.150.119
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet.webcontrols:11726
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
|
| I have a gridview tied to a single table in a sql server database. I have
| created an update query on the datasource
|
| UPDATE dbo.PredefinedTasks SET PredefinedTask = @PredefinedTask,
| TaskFilterID = @TaskFilterID WHERE (PredefinedTaskID =
| @original_PredefinedTaskID)
|
| I have enabled the gridview for editing. When I click edit, i change the
| PredefinedTask column and click update. The row returns to an edit row
but
| the changes I made are not reflected.
|
| I had several gridviews working with Beta 2, but now they are doing the
same
| change. What am I missing?
|
|
|
 
R

Rickey Whitworth

I've done some more searching on the web, my problem appears to be related
to the fact that Microsoft has changed the default setting for
OldValuesParameterFormatString to {0} where it used to be original_{0}

If I go and change this value to its beta 2 default, my updates work fine.
Before I did this I tried changing my update query parameter from
@original_PredefinedTaskID to @PredefinedTaskID, but this doesn't work. I'm
assuming Microsoft changed the default value for a reason, so there must be
a new recommended way to write update queries. Any one have any ideas?
 
S

Steven Cheng[MSFT]

Hi Rickey,

Can you reproduce the behavior through a standard sample database, like the
NorthWind or Pubs? If so, would you try posting a simple test page here so
that I can have a test on my side? Also, as I mentioned in the former
thread, since there could exists some mini changes on the gridview or
datasource control's template syntax, the recommend means is to
reconfigure the SqlDatasource and rebind it to the DataBinding control .

Please feel free to let me know if you need any assistance.

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.)
--------------------
| From: "Rickey Whitworth" <[email protected]>
| References: <[email protected]>
| Subject: Re: Gridview Updates not writing to database after clicking
update
| Date: Mon, 7 Nov 2005 07:59:59 -0600
| Lines: 28
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
| X-RFC2646: Format=Flowed; Response
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| NNTP-Posting-Host: 66.182.150.119
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet.webcontrols:11737
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
|
| I've done some more searching on the web, my problem appears to be
related
| to the fact that Microsoft has changed the default setting for
| OldValuesParameterFormatString to {0} where it used to be original_{0}
|
| If I go and change this value to its beta 2 default, my updates work
fine.
| Before I did this I tried changing my update query parameter from
| @original_PredefinedTaskID to @PredefinedTaskID, but this doesn't work.
I'm
| assuming Microsoft changed the default value for a reason, so there must
be
| a new recommended way to write update queries. Any one have any ideas?
|
| | >I have a gridview tied to a single table in a sql server database. I
have
| >created an update query on the datasource
| >
| > UPDATE dbo.PredefinedTasks SET PredefinedTask = @PredefinedTask,
| > TaskFilterID = @TaskFilterID WHERE (PredefinedTaskID =
| > @original_PredefinedTaskID)
| >
| > I have enabled the gridview for editing. When I click edit, i change
the
| > PredefinedTask column and click update. The row returns to an edit row
but
| > the changes I made are not reflected.
| >
| > I had several gridviews working with Beta 2, but now they are doing the
| > same change. What am I missing?
| >
|
|
|
 
S

Steven Cheng[MSFT]

Hi Rickey,

Have you got any progress on this? 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: 64509598
| References: <[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: Tue, 08 Nov 2005 03:16:32 GMT
| Subject: Re: Gridview Updates not writing to database after clicking
update
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| Lines: 74
| Path: TK2MSFTNGXA01.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet.webcontrols:11752
| NNTP-Posting-Host: tomcatimport2.phx.gbl 10.201.218.182
|
| Hi Rickey,
|
| Can you reproduce the behavior through a standard sample database, like
the
| NorthWind or Pubs? If so, would you try posting a simple test page here
so
| that I can have a test on my side? Also, as I mentioned in the former
| thread, since there could exists some mini changes on the gridview or
| datasource control's template syntax, the recommend means is to
| reconfigure the SqlDatasource and rebind it to the DataBinding control .
|
| Please feel free to let me know if you need any assistance.
|
| 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.)
| --------------------
| | From: "Rickey Whitworth" <[email protected]>
| | References: <[email protected]>
| | Subject: Re: Gridview Updates not writing to database after clicking
| update
| | Date: Mon, 7 Nov 2005 07:59:59 -0600
| | Lines: 28
| | X-Priority: 3
| | X-MSMail-Priority: Normal
| | X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
| | X-RFC2646: Format=Flowed; Response
| | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
| | Message-ID: <[email protected]>
| | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| | NNTP-Posting-Host: 66.182.150.119
| | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| | Xref: TK2MSFTNGXA01.phx.gbl
| microsoft.public.dotnet.framework.aspnet.webcontrols:11737
| | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
| |
| | I've done some more searching on the web, my problem appears to be
| related
| | to the fact that Microsoft has changed the default setting for
| | OldValuesParameterFormatString to {0} where it used to be original_{0}
| |
| | If I go and change this value to its beta 2 default, my updates work
| fine.
| | Before I did this I tried changing my update query parameter from
| | @original_PredefinedTaskID to @PredefinedTaskID, but this doesn't work.
| I'm
| | assuming Microsoft changed the default value for a reason, so there
must
| be
| | a new recommended way to write update queries. Any one have any ideas?
| |
| | | | >I have a gridview tied to a single table in a sql server database. I
| have
| | >created an update query on the datasource
| | >
| | > UPDATE dbo.PredefinedTasks SET PredefinedTask = @PredefinedTask,
| | > TaskFilterID = @TaskFilterID WHERE (PredefinedTaskID =
| | > @original_PredefinedTaskID)
| | >
| | > I have enabled the gridview for editing. When I click edit, i change
| the
| | > PredefinedTask column and click update. The row returns to an edit
row
| but
| | > the changes I made are not reflected.
| | >
| | > I had several gridviews working with Beta 2, but now they are doing
the
| | > same change. What am I missing?
| | >
| |
| |
| |
|
|
 
R

Rickey Whitworth

I haven't had a chance to dig into it any deeper. For now it works with the
change, so I am happy. Thanks for your help.

Steven Cheng said:
Hi Rickey,

Have you got any progress on this? 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: 64509598
| References: <[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: Tue, 08 Nov 2005 03:16:32 GMT
| Subject: Re: Gridview Updates not writing to database after clicking
update
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| Lines: 74
| Path: TK2MSFTNGXA01.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet.webcontrols:11752
| NNTP-Posting-Host: tomcatimport2.phx.gbl 10.201.218.182
|
| Hi Rickey,
|
| Can you reproduce the behavior through a standard sample database, like
the
| NorthWind or Pubs? If so, would you try posting a simple test page here
so
| that I can have a test on my side? Also, as I mentioned in the former
| thread, since there could exists some mini changes on the gridview or
| datasource control's template syntax, the recommend means is to
| reconfigure the SqlDatasource and rebind it to the DataBinding control .
|
| Please feel free to let me know if you need any assistance.
|
| 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.)
| --------------------
| | From: "Rickey Whitworth" <[email protected]>
| | References: <[email protected]>
| | Subject: Re: Gridview Updates not writing to database after clicking
| update
| | Date: Mon, 7 Nov 2005 07:59:59 -0600
| | Lines: 28
| | X-Priority: 3
| | X-MSMail-Priority: Normal
| | X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
| | X-RFC2646: Format=Flowed; Response
| | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
| | Message-ID: <[email protected]>
| | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| | NNTP-Posting-Host: 66.182.150.119
| | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| | Xref: TK2MSFTNGXA01.phx.gbl
| microsoft.public.dotnet.framework.aspnet.webcontrols:11737
| | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
| |
| | I've done some more searching on the web, my problem appears to be
| related
| | to the fact that Microsoft has changed the default setting for
| | OldValuesParameterFormatString to {0} where it used to be original_{0}
| |
| | If I go and change this value to its beta 2 default, my updates work
| fine.
| | Before I did this I tried changing my update query parameter from
| | @original_PredefinedTaskID to @PredefinedTaskID, but this doesn't
work.
| I'm
| | assuming Microsoft changed the default value for a reason, so there
must
| be
| | a new recommended way to write update queries. Any one have any ideas?
| |
| | | | >I have a gridview tied to a single table in a sql server database. I
| have
| | >created an update query on the datasource
| | >
| | > UPDATE dbo.PredefinedTasks SET PredefinedTask = @PredefinedTask,
| | > TaskFilterID = @TaskFilterID WHERE (PredefinedTaskID =
| | > @original_PredefinedTaskID)
| | >
| | > I have enabled the gridview for editing. When I click edit, i change
| the
| | > PredefinedTask column and click update. The row returns to an edit
row
| but
| | > the changes I made are not reflected.
| | >
| | > I had several gridviews working with Beta 2, but now they are doing
the
| | > same change. What am I missing?
| | >
| |
| |
| |
|
|
 
S

Steven Cheng[MSFT]

Thanks for your followup.

Glad that it already been working for you.
If you need any other assistance, please feel free to post here.

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: "Rickey Whitworth" <[email protected]>
| References: <[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
| Subject: Re: Gridview Updates not writing to database after clicking
update
| Date: Thu, 10 Nov 2005 08:52:05 -0600
| Lines: 125
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| NNTP-Posting-Host: 66.182.150.119
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet.webcontrols:31053
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
|
| I haven't had a chance to dig into it any deeper. For now it works with
the
| change, so I am happy. Thanks for your help.
|
| | > Hi Rickey,
| >
| > Have you got any progress on this? 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: 64509598
| > | References: <[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: Tue, 08 Nov 2005 03:16:32 GMT
| > | Subject: Re: Gridview Updates not writing to database after clicking
| > update
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
| > | Message-ID: <[email protected]>
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| > | Lines: 74
| > | Path: TK2MSFTNGXA01.phx.gbl
| > | Xref: TK2MSFTNGXA01.phx.gbl
| > microsoft.public.dotnet.framework.aspnet.webcontrols:11752
| > | NNTP-Posting-Host: tomcatimport2.phx.gbl 10.201.218.182
| > |
| > | Hi Rickey,
| > |
| > | Can you reproduce the behavior through a standard sample database,
like
| > the
| > | NorthWind or Pubs? If so, would you try posting a simple test page
here
| > so
| > | that I can have a test on my side? Also, as I mentioned in the
former
| > | thread, since there could exists some mini changes on the gridview or
| > | datasource control's template syntax, the recommend means is to
| > | reconfigure the SqlDatasource and rebind it to the DataBinding
control .
| > |
| > | Please feel free to let me know if you need any assistance.
| > |
| > | 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.)
| > | --------------------
| > | | From: "Rickey Whitworth" <[email protected]>
| > | | References: <[email protected]>
| > | | Subject: Re: Gridview Updates not writing to database after clicking
| > | update
| > | | Date: Mon, 7 Nov 2005 07:59:59 -0600
| > | | Lines: 28
| > | | X-Priority: 3
| > | | X-MSMail-Priority: Normal
| > | | X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
| > | | X-RFC2646: Format=Flowed; Response
| > | | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527
| > | | Message-ID: <[email protected]>
| > | | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| > | | NNTP-Posting-Host: 66.182.150.119
| > | | Path:
TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| > | | Xref: TK2MSFTNGXA01.phx.gbl
| > | microsoft.public.dotnet.framework.aspnet.webcontrols:11737
| > | | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
| > | |
| > | | I've done some more searching on the web, my problem appears to be
| > | related
| > | | to the fact that Microsoft has changed the default setting for
| > | | OldValuesParameterFormatString to {0} where it used to be
original_{0}
| > | |
| > | | If I go and change this value to its beta 2 default, my updates work
| > | fine.
| > | | Before I did this I tried changing my update query parameter from
| > | | @original_PredefinedTaskID to @PredefinedTaskID, but this doesn't
| > work.
| > | I'm
| > | | assuming Microsoft changed the default value for a reason, so there
| > must
| > | be
| > | | a new recommended way to write update queries. Any one have any
ideas?
| > | |
| > | | | > | | >I have a gridview tied to a single table in a sql server database.
I
| > | have
| > | | >created an update query on the datasource
| > | | >
| > | | > UPDATE dbo.PredefinedTasks SET PredefinedTask = @PredefinedTask,
| > | | > TaskFilterID = @TaskFilterID WHERE (PredefinedTaskID =
| > | | > @original_PredefinedTaskID)
| > | | >
| > | | > I have enabled the gridview for editing. When I click edit, i
change
| > | the
| > | | > PredefinedTask column and click update. The row returns to an edit
| > row
| > | but
| > | | > the changes I made are not reflected.
| > | | >
| > | | > I had several gridviews working with Beta 2, but now they are
doing
| > the
| > | | > same change. What am I missing?
| > | | >
| > | |
| > | |
| > | |
| > |
| > |
| >
|
|
|
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top