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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:48:07+00:00 2026-06-13T00:48:07+00:00

I need to create a procedure that will store data into 3 tables, while

  • 0

I need to create a procedure that will store data into 3 tables, while using data from each table to reference the rest.

E.g.: I am creating a team challenge database. This will allow a person to challenge another, setup who will be in each others teams, then store in into a database.

I have a primary table which stores the matchId, initiatorName, teamOneListId and teamTwoListId.

  • TeamOneList: ID, memberID, TeamName
  • TeamTwoList: ID, memberID, TeamName

As you can see, I need to add data into all of them at once (While having the team size and limits vary for 1v1, 3v3 etc).

I am using C# Asp.Net, and am well-versed in Transactions. I am just not too clued up in databasing.

EDIT: Wrote this at the end of a long hard day.
The question is, what would be the simplest way or method of going about this?

I’ve tried to mess around with the stored procedure, I can forward identities to the different tables, but it seems I still have to create a new stored procedure for both teams, and for every type of event.

The only way I could get the aforementioned working was to start a match, get the last row’s information, and forward that to a second page binding the rest of the 2 teams information into the database.

So to reiterate, I need to know how to do all this at once, or have a way of not simply getting the last row (that might be wrong?).

  • 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-13T00:48:08+00:00Added an answer on June 13, 2026 at 12:48 am

    You can try with SqlDataAdapter class

    Link : http://msdn.microsoft.com/fr-fr/library/system.data.sqlclient.sqldataadapter(v=vs.80).aspx

    var connection = new SqlConnection("...");//You can adjust your string connection
    var adapter = new SqlDataAdapter();
    
    // Create the SelectCommand.
    var command = new SqlCommand("YourSelectStoredProcedure", connection); //You can adjust your name of stored procedure
    command.CommandType = CommandType.StoredProcedure;
    adapter.SelectCommand = command;
    
    // Create the InsertCommand.
    command = new SqlCommand("YourInsertStoredProcedure", connection); //You can adjust your name of stored procedure
    command.CommandType = CommandType.StoredProcedure;
    adapter.InsertCommand = command;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Parsing some data and inserting it into 3 tables from .NET. Using Table Valued
I need to write a stored procedure that will provide the data from two
I need to create a report using SQL Server 2008R2 Stored procedure that will
I'm trying to create a stored procedure that will search all user created tables
i am trying to create sql procedure or function that need to find duplicate
Need to create a custom DNS name server using C which will check against
I currently have a stored procedure that copies content from one table to another.
I need to create a view from several tables. One of the columns in
I am using a stored procedure to insert data into a database, when it
i'm putting values into SQL Server using a Stored Procedure. The Procedure will add

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.