ASP

 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me



Go Back   Tutorialized ForumsWeb Design & DevelopmentASP

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Tutorialized Forums Sponsor:
  #1  
Old June 2nd, 2006, 05:25 AM
wanni wanni is offline
Contributing User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Jun 2006
Posts: 1 wanni New User: is a brand new recruit and a unknown entity at this point. 
Time spent in forums: < 1 sec
Reputation Power: 0
ASP making 2 connections in one page

I am making an ASP website,
but the data on the ASP page are from 2 different database
how do I make connections to 2 different database and combine the data on the page?


thanks

Reply With Quote
  #2  
Old October 10th, 2012, 12:51 AM
VanessaMeacham VanessaMeacham is offline
Registered User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Sep 2012
Location: USA
Posts: 53 VanessaMeacham User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 h 59 m 31 sec
Reputation Power: 3
how to connect 2 different database and combine the data on the page

Hi! I think this will help you i am not sure for it.

SqlConnection con1 = new SqlConnection(System.Configuration.ConfigurationMa nager.ConnectionStrings["con1"].ConnectionString);
SqlConnection con2 = new SqlConnection(System.Configuration.ConfigurationMa nager.ConnectionStrings["con2"].ConnectionString);

SqlCommand cmd = new SqlCommand("select * from table1", con1);
SqlDataReader dr;
con1.Open();
dr = cmd.ExecuteReader(CommandBehavior.SingleResult);
while (dr.Read())
{
// ....
}dr.Close()

//your condition then fire insert commnd with connection con2

SqlCommand insertcmd = new SqlCommand("insert into table2", con2);
SqlDataAdapter dap = new SqlDataAdapter(insertcmd);
// ...

Reply With Quote
Reply

Viewing: Tutorialized ForumsWeb Design & DevelopmentASP > ASP making 2 connections in one page


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.

© 2003-2014 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap