Bind Data in Grid View two Database in single query.
i have two database
1.CRMS
2.ERP
i want to bind the data from two database(Tables)
For Example:
my connection string is ,
SqlConnection con = new SqlConnection("Server=(local);initial catalog=CRMS;Trusted_Connection=True");
SqlConnection con = new SqlConnection("Server=(local);initial catalog=ERP;Trusted_Connection=True");
Thanks&Regs
Magesh
Bind Data in Grid View two Database in single query and single Gridview?
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

venkata saibabu10 reputationPosted Feb 22, 2012, 1:05 AM EST
Jignesh TrivediRank #16 · 50.3K reputationPosted Feb 22, 2012, 1:23 AM EST
current Answer is good idea, but it has some limitation like its hard code data base name in query.
I think use data relationship or LINQ-DataSet.
http://www.codeproject.com/Articles/18304/Using-Data-Relation-with-Data-Table
http://msdn.microsoft.com/en-us/library/ay82azad%28v=vs.71%29.aspx
Good article
http://blogs.msdn.com/b/adonet/archive/2007/01/26/querying-datasets-introduction-to-linq-to-dataset.aspx
hope this help.