READ AND WRITE ON DIFFERENT SERVER DATABASE

Hi All,

I have 2 server, let's say Client's Server and Main Server.
Let's say my app is called on Client's Server and I one to get some data from Main Server.
Its mean read from Main Server and write to Client's Server.

How could I do it ?
How many way to achieve it?

Thank you.

LVL 1
emi_sastraAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Shaun KlineLead Software EngineerCommented:
The simplest way would be to use to separate connection objects, one for your server and one for the client's server.
0
CodeCruiserCommented:
You can use two different connection strings for each server and use the one required in command objects.
0
emi_sastraAuthor Commented:
Hi Shaun_Kline,

How could I do it ?

Thank you.
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

emi_sastraAuthor Commented:
Hi CodeCruiser,

How could I do it ?

Thank you.
0
emi_sastraAuthor Commented:
Hi All,

Using what code to achieve it ?

Thank you.
0
CodeCruiserCommented:
Dim ClientConnectionString as String = "Client connection string"
Dim ServerConnectionString As String = "server Connection String"

If ServerRequired Then
   dbcon.ConnectionString = ServerConnectionString
Else
   dbcon.ConnectionString = ClientConnectionString
End If
0
emi_sastraAuthor Commented:
That is the connection string only.
Using what to read and write it ?

Thank you.
0
Imran Javed ZiaConsultant Software Engineer - .NET ArchitectCommented:
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
CodeCruiserCommented:
the usual SqlCommand and SqlConnection or SqlDataAdapters etc. What is the functional requirement?
0
emi_sastraAuthor Commented:
What I meant is using :

1. SQLDataReader
2. SQLDataTable or Dataset
3. LINQ.

I don't want to use looping to do so, one of the solution is using Linked Server.

Any other solution to do it, just one shot and the task is done ?

Thank you.
0
emi_sastraAuthor Commented:
Hi IJZ,

If not using Linked Server, is there any solution ?

Thank you.
0
Imran Javed ZiaConsultant Software Engineer - .NET ArchitectCommented:
in that consider to use bulk insert
0
Anthony PerkinsCommented:
>>I don't want to use looping to do so, one of the solution is using Linked Server.<<
Have you created a linked server and tested that it returns the desired results?
0
CodeCruiserCommented:
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.