Updating table at a different database

G

Guest

Hello,
I'm using SqlDataAdapter to get records from table at database different
from my connection using the databasename at the select statment
"Select * from otherdb..myTable"
After updating the data I want to update the table, I'm using
SqlCommandBuilder to set the UpdateCommand at the SqlDataAdapter.
But when I use the SqlDataAdapter.Update I get an error :
"Invalid object name 'myTable'"
I tried to change the UpdateCommandText to "Update otherdb..myTable ..."
but it's not working.
I don't want to use another connection.
Is there a way of making it work?

Thanks,
Sharon.
 
C

Cor Ligthert

Sharon,

What is the reason of
I don't want to use another connection.

Normally when you do it right you are creating everytime a new connection,
so why is this such a big issue?

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top