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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T02:24:38+00:00 2026-06-10T02:24:38+00:00

We have a stored proc that grabs that data from a table, let’s call

  • 0

We have a stored proc that grabs that data from a table, let’s call it table1 from one db1 and populates a table, called table2 in db2.

We scheduled this stored proc to perform this function like every 5 minutes. This works fine.

Given that users mostly leave their apps while performing other administrative functions, we have created a refresh button that refreshes the GridView upon clicking the button.

Protected Sub Refresh_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Refresh.Click
    ' Clean up text to return the GridView to it's default state
      strSearch.Text = ""
      SearchString = ""
      gridView1.DataBind()
End Sub

We would like to both click this refresh button to both to have the stored procedure update table2 and at same time, refresh the GridView.

I know that gridview1.Databind() refreshes the GridView with latest data from table2 but how do I ensure that table2 is first updated with data from table1 using the stored proc before refreshing the GridView.

  • 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-06-10T02:24:40+00:00Added an answer on June 10, 2026 at 2:24 am

    Kenny I have prepared complete code in vb for you, take a look:

    Private Sub CallRefresh()
         Dim connectionString As String = "Initial Catalog=myDataBase;data source=myServer;Integrated Security=SSPI;"
         Dim storedProcName As String = "ActivateServerTask"
         Dim conn As SqlConnection = New SqlConnection(connectionString)
         conn.Open()
         Dim command As SqlCommand = New SqlCommand(storedProcName, conn)
         command.CommandType = CommandType.StoredProcedure
         command.Parameters.Add(New SqlParameter("@taskId", 1))
         command.ExecuteNonQuery()
         command.Dispose()
         conn.Close()
         conn.Dispose()
     End Sub
    
    
     Protected Sub Refresh_Click(ByVal sender As Object, ByVal e As EventArgs) Handles     Refresh.Click       
          CallRefresh()
          gridView1.DataBind()       
     End Sub 
    

    CallRefresh opens connection, executes “ActivateServerTask” stored procedure with “taskId” parameter and finally closes connection…
    Take notice I am using connection to sql with integrated security.
    You can find other connection strings here:
    http://www.connectionstrings.com/

    Happy coding Kenny!

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

Sidebar

Related Questions

I have a data-source connected to a stored proc that will return the one
Say i have a stored proc that inserts some data into a table. If
I have a stored proc, SP1, which executes and does select on one table.
I have a stored proc that produces a table like this: PeriodStart PeriodEnd TotalActive
I have a stored proc that is called from my asp.net page. The field
I have a stored proc that takes one integer parameter. I am calling this
I have a stored proc that inserts XML into an underlying table. Unfortunately the
I have a stored proc that I need to execute 100 times (one for
I have one oracle stored proc that will select customers based on a condition
I have a stored proc that I am passing two parameters into. One parameter

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.