Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old June 6th, 2010, 07:09 PM
Authorized User
Join Date: May 2007
Posts: 73
Thanks: 4
Thanked 0 Times in 0 Posts
Default update gridview record

Hi i am trying to update record inside gridview. although i am not getting any error but its not updating the record either.

<asp:GridView ID="GV_ApproveNomination" runat="server" AutoGenerateColumns ="TRUE" DataKeyNames="ContestantID" DataSourceID ="sqlDataSource1">

<asp:BoundField DataField="ContestantID" HeaderText="ContestantID" />
<asp:BoundField DataField="iContestantName" HeaderText="Contestant Name" />
<asp:BoundField DataField="iContestantCompany" HeaderText="Contestant Company" />
<asp:CommandField ShowEditButton="True"/>

<asp:TemplateField HeaderText="ContestantID" SortExpression="ContestantID">
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Activate") %>'></asp:TextBox>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("Activate") %>'></asp:Label>



<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:GAConnectionString %>"
SelectCommand ="SELECT [ContestantID], [iContestantName] ,[iContestantCompany] ,[iContestantStore] ,[iNominationText] ,[iNominatorPhone] ,[iNominatorEmail], [Activate] FROM [NhmMicrosites].[dbo].[SMOTY_tblContestant]"
UpdateCommand ="UPDATE SMOTY_tblContestant SET Activate =@Activate where ContestantID = @ContestantID"
<asp:Parameter Name="Activate" Type ="int32" />
<asp:Parameter Name="ContestantID" Type ="int32" />


Similar Threads
Thread Thread Starter Forum Replies Last Post
Gridview Update not firing in Update Panel akshay144 Ajax 1 August 13th, 2009 10:20 AM
Using a dropdown box in a GridView - How do I update the record with the dd's value? RushNP774 ASP.NET 3.5 Basics 14 March 15th, 2009 02:57 AM
Disp Footer even no record in GridView Datasource mallikalapati ASP.NET 2.0 Professional 1 March 19th, 2008 02:23 AM
Problem with: Add new record in GridView kalchev ASP.NET 2.0 Basics 0 April 26th, 2006 07:59 AM
Select gridview record with mouseclick wirerider ASP.NET 2.0 Basics 2 March 9th, 2006 01:44 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.