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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T23:06:18+00:00 2026-05-10T23:06:18+00:00

Is there a way to update more than one Database having same schema using

  • 0

Is there a way to update more than one Database having same schema using single ObjectDataSource in C#???

i.e Just by providing more than one connection string is it some how possible to update more than one Database? I need to update/insert same record in multiple Database with same schema using ObjectDataSource in C#.

  • 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. 2026-05-10T23:06:19+00:00Added an answer on May 10, 2026 at 11:06 pm

    Yes you can do it, since with an ObjectDataSource YOU ae the one writing the code that does the insert. Inside your ‘Update’ and ‘Delete’ methods you can simply perform two database actions, one for each database that you are working with. You can abstract this out to an operation that could be passed a connection to ensure that you don’t have duplicate code sitting everywhere.

    NOTE
    You CANNOT do this thought via a single connection, you must do two fully separate database actions.

    Example

    Per the comment there was a request for more detail.

    Basically inside each of your methods, simply do two db calls, a crude AND NOT properly formed example to show the concept is below, for a ‘delete’ method.

    public void DeleteMyObject(int objectId) {     SqlConnection connectionOne = new SqlConnection('MyFirstDbConnection');     SqlConnection connedtionTwo = new SqlConnection('MySecondDbCOnnection');     SqlCommand myCommand = new SqlCommand(connectionOne);     myCommand.CommandText = 'DELETE FROM myTable where myid = ' + objectId.ToString();     connectionOne.Open();     myCommand.ExecuteNonQuery();     connectionOne.Close();     myCommand.Connection = connectionTwo;     connectionTwo.Open();     myCommand.ExecuteNonQuery();     connectionTwo.Close(); } 

    Obviously the usage of a stored procedure, as well as proper using statements or try/catch is needed, but this gets the idea across.

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

Sidebar

Ask A Question

Stats

  • Questions 109k
  • Answers 110k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You cannot share instances of classes directly between AppDomains. To… May 11, 2026 at 9:30 pm
  • Editorial Team
    Editorial Team added an answer You will have to use something like the MLj Compiler.… May 11, 2026 at 9:30 pm
  • Editorial Team
    Editorial Team added an answer Well, you can add it to the output array by… May 11, 2026 at 9:30 pm

Related Questions

I have a databases table with ~50K rows in it, each row represents a
I'm just starting out with LINQ to Entities, and I'm trying to replicate a
I have to maintain an old database which is not properly normalized. For instance
I am writing an application that logs status updates (GPS locations) from devices to

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.