Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6131151
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:56:27+00:00 2026-05-23T16:56:27+00:00

I have a dynamic gridview with data pulled from oracle database. <asp:GridView ID=gvData OnRowDataBound=gvData_RowDataBound

  • 0

I have a dynamic gridview with data pulled from oracle database.

<asp:GridView ID="gvData" OnRowDataBound="gvData_RowDataBound" OnPreRender="gvData_PreRender" OnSelectedIndexChanged="gvData_SelectedIndexChanged" OnLoad="gvData_Load" OnRowCommand="gvData_RowCommand" runat="server" CellPadding="4" ForeColor="#333333" AllowPaging="True" AutoGenerateDeleteButton="True" AutoGenerateEditButton="True" DataSourceID="DS" AllowSorting="True" AutoGenerateSelectButton="True" PageSize="10" ShowFooter="True">
        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#284775" ForeColor="White" />
        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <EditRowStyle BackColor="#CCCCCC" />
        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
    </asp:GridView>
    <asp:SqlDataSource ID="DS" runat="server">
    </asp:SqlDataSource>

I am trying to write DELETE/UPDATE statements. I am having a problem with getting values from gridview and adding them to the parameters os SQL statements.

protected void gvData_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
    DS.DeleteCommand =
            "DELETE FROM TABLE " +
            "WHERE PROBLEM_DEPTH_MD = :PROBLEM_DEPTH_MD";
            "AND API = :API " +
            "AND BUS_AREA_ID = :BUS_AREA_ID";
    DS.DeleteParameters.Add(new Parameter("PROBLEM_DEPTH_MD", TypeCode.String, ??GridViewItemValue??));
}

I don’t know how to get a value from the gridview. Any suggestions? Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T16:56:27+00:00Added an answer on May 23, 2026 at 4:56 pm

    First off you need to mention the DataKeyName to your gridview of your Primary key Column and then you can access the value of the Selected row of the Gridview like… e.Keys["DataKeyName"]

    If you want to access a non key field, then it should be like… e.Values["FieldName"]

    Mention DataKeyName like… <asp:GridView ID="gvData" DataKeyNames="PrimaryKeyColumn"

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a page showing results from database in a gridview in Dynamic data
I have a Dynamic Data Entities Web Application that uses a database with GUIDs
I have a dynamic text file that picks content from a database according to
I have a dynamic (allows addition of rows on the fly) an ASP gridview
I have dynamic data shown in Excel. The data itself is pulled using COM
Here's the scenario: I have an asp.net webpage which displays dynamic data in a
i have a GridView (selectable) in which I want to generate a dynamic GridView
I have a a gridview with a dynamic number of columns and rows. In
I have dynamic array filled with bytes, which are read from .raw file with
I have built a dynamic gridview using the following code grdVariants.Columns.Clear(); int i =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.