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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:14:17+00:00 2026-05-27T21:14:17+00:00

Sorry in advance im going to try and explain this as best as possible….

  • 0

Sorry in advance im going to try and explain this as best as possible….

I have 2 asp.net pages one named membermaster and the second named memberdetails. I created a class library which contains 2 functions

My first function returns a list depending on the search result…

I added a linkbutton to the gridviews first column which when clicked it passes through querystring the membershipgen. What i wanted to do is for my second function i created this

public DataTable GetMembers(int MEMBERSHIPGEN)
{
  DataTable table = null;
  SqlConnection con = null;
  SqlCommand cmd = null;
  SqlDataAdapter ad = null;
  SqlParameter prm = null;
  try
  {
      table = new DataTable();
    using (con = new SqlConnection(connectionString))
    {
        using (cmd = new SqlCommand("usp_getmemberdetail", con))
        {
            using (ad = new SqlDataAdapter(cmd))
            {
                prm = new SqlParameter("@MEMBERSHIPGEN", SqlDbType.Int);
                prm.Value = MEMBERSHIPGEN;
                cmd.Parameters.Add(prm);
                ad.Fill(table);
            }

        }
    }
  }
  catch (Exception ex)
  {
        //write your exception code here
  }
  return table;
}

In the attempt to try and send the membershipgen to this and it return the results. But once i compile the DLL and add it to my project I am not sure how i would reference this function to populate individual textboxes and labels with the information.

What I am trying to do is when a user clicks the viewdetails button on the gridview I can then use that membershipgen that I passed through querystring to populate the page through a stored procedure but the smarts would be stored in a DLL.

  • 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-27T21:14:18+00:00Added an answer on May 27, 2026 at 9:14 pm

    You need to change GetMembers to return data instead of void. If you want to use DataTables, you can just modify your code to this:

    public DataTable GetMembers(int MEMBERSHIPGEN)
    {
        DataTable table = new DataTable();
        SqlConnection con = new SqlConnection(connectionString);
    
        using (SqlCommand cmd = new SqlCommand("usp_getmemberdetail", con))
        {
            using (SqlDataAdapter ad = new SqlDataAdapter(cmd))
            {
                SqlParameter prm = new SqlParameter("@MEMBERSHIPGEN", SqlDbType.Int);
                prm.Value = MEMBERSHIPGEN;
                cmd.Parameters.Add(prm);
                ad.Fill(table);
                return table;
            }
    

    Then in your Page_Load it might be something like this (more robust than this hopefully):

    {
        DataTable table = yourDll.GetMembers(Convert.ToInt32(Request.QueryString["membership"]));
        label1.Text = Convert.ToString(table.rows[0]["Name"]);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am going to do my best to explain this, though admittedly I have
Sorry in advance if I have some of this wrong. I may edit to
Sorry in advance for this incredibly simple question, but what is the best way
Im quite new at this .....sorry in advance. I have created an app in
Sorry in advance for this being such a beginner question. Here are the steps
Sorry in advance everyone for this question as I know the cascading select boxes
I am new to JPA and JBoss, so sorry in advance if this is
Sorry if this is too simple, but thanks in advance for helping. This is
Sorry in advance if I'm not explaining this correctly. I want to know if
Sorry in advance if this is a repeat question. I didn't see it listed

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.