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 5841951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T11:57:18+00:00 2026-05-22T11:57:18+00:00

I am trying to use a label from another row in the gridview and

  • 0

I am trying to use a label from another row in the gridview and insert it in a table when the user clicks the button which is in its own column.

my problem is that i cant get bookno which finds the label set to the @bookno in my sqldatasource

Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim selectedRow As Button = DirectCast(sender, Button)



        Dim bookno As Label = CType(selectedRow.FindControl("label1"), Label)
        Dim why As TextBox = CType(selectedRow.FindControl("textbox2"), TextBox)
        Dim yesint As Integer = 1
        Dim sql As SqlDataSource = CType(selectedRow.FindControl("sqldatasource4"), SqlDataSource)
        sql.InsertParameters.Add(bookno.Text, 0)


        sql.Insert()

    End Sub
  • 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-22T11:57:19+00:00Added an answer on May 22, 2026 at 11:57 am

    Try

    Dim bookno As Label = CType(selectedRow.Parent.FindControl("label1"), Label)
    

    and see if you get a valid control for bookno. If it works, do the same for other FindControl() calls.

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

Sidebar

Related Questions

I'm trying to use a radio button in my modelform but its just outputting
I'm trying to use David Poll's printcollection control, from the SLaB project- www.davidpoll.com but
I'm trying to acquire a JSON which is being sent from an https secure
I'm trying to use Flot to plot a graph with dates. I've followed the
I'm trying to use jQuery to fill in a form in an iFrame. Do
I am just trying to make a timer. I would like to use UIDatePickerModeCountDownTimer
I'm trying to place the Facebook multi-friend-selector in a Facebox (don't want to use
I'm trying to write a route that captures the one-to-many relationship between posts and
I tried every trick in the book, creating a new object, instantiating it (even
Is there a look-and-feel-independent way to align a component (e.g. a JLabel ) horizontally

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.