Flovit Posted May 7, 2004 Posted May 7, 2004 I want to use table1 in page1 and table2 in page2 of a database in one website . when I add table2 to page2 my page1 connection lost . please help me . Quote
Administrators PlausiblyDamp Posted May 8, 2004 Administrators Posted May 8, 2004 Any chance you could post a bit of your code to give us some idea of how you are attempting this? Are you creating and opening a connection on every page? Are you refreshing the dataset on page_loads or storing it in a session variable between page refreshes? the following may be worth a look as well http://www.xtremedotnettalk.com/showthread.php?t=75209 http://www.xtremedotnettalk.com/showthread.php?t=75076 Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Flovit Posted May 8, 2004 Author Posted May 8, 2004 I dont know the right way for doing this , but what I tried is code something like this : in page1 this.dbCon = new System.Data.OleDb.OleDbConnection() ; this.adb1 = new System.Data.OleDb.OleDbDataAdapter(); this.ds1 = new ShipProject.dataset1(); this.dbCon.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("~/database/data.mdb") ; in page2 I cant access to dbCon so I create another one like page1's connection . but the problem apeared : my first dbConnection lost . What I must to do for it , Thanks Quote
pelikan Posted May 28, 2004 Posted May 28, 2004 ADO .NET uses a disconnected dataset model - you should load both your tables into one dataset using one connection - the connection is then released - now use your tables. Quote IN PARVUM MULTUM
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.