CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

ASP.NET Web Hosting – 3 Months Free!



Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 8/31/2007 12:55:35 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 4 Views: 20 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
5 Items, 1 Pages 1 |< << Go >> >|
rossignolc
Asp.Net User
Share DB Connection in all web user controlers on page8/31/2007 12:55:35 PM

0/0

ASP.NET 2.0 

I opened a database connection in the master page, I check in the code behind also if the user has access to the page and get some user info from the database, such as his language..

I have also a few web user controlers and other web forms in the master page.

- How can I use same the database connection from the master page in the other web forms and - controls in the same page?

- How can I access the variabels from the master page.

I tried several solutions, but without success.

Thx

 

Suprotim Agarwa
Asp.Net User
Re: Share DB Connection in all web user controlers on page9/1/2007 12:46:55 PM

0/0

Hi,

Use properties :

Master Page

        private string connectionString;

        public string ConnectionString
        {
            get { return connectionString; }
            set { connectionString= value; }
        }

In your content page:

string conn = Master.ConnectionString;

 I would however suggest to create a seperate connection class.

 

HTH,
Suprotim Agarwal

-----
http://www.dotnetcurry.com
-----


Don't forget to click "Mark as Answer" on the post that helped you. This will help readers to know which post solved your issue and make their search easy
Suprotim Agarwa
Asp.Net User
Re: Share DB Connection in all web user controlers on page9/1/2007 12:48:50 PM

0/0

One more thing : 

Dont forget to add this in your content pages

<%@ MasterType VirtualPath="default.master" %>

 

HTH,
Suprotim Agarwal

-----
http://www.dotnetcurry.com
-----


Don't forget to click "Mark as Answer" on the post that helped you. This will help readers to know which post solved your issue and make their search easy
rossignolc
Asp.Net User
Re: Share DB Connection in all web user controlers on page9/1/2007 3:14:37 PM

0/0

 Hi Thx,

 I coded already a kind of connection class, but when I declare my connection class in the master page, than the database connection will open in the master page code behind.

How can I give the active db connection to the web user controls and forms in the page self?

I think I have to use one single connection, because othertimes I got an error message max_user_connections (client wants MySQL). I always closed the connection, but get this message.

 

Qandil
Asp.Net User
Re: Share DB Connection in all web user controlers on page9/1/2007 8:27:29 PM

0/0

 Did you try saving the connection in the Web.Config file

 

then u can use it all over the website 

5 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Internet Applications in Product Design and Manufacturing: Electronic Commerce Engineering Authors: George Q. Huang, K. L. Mak, Pages: 272, Published: 2003
Expert ASP.NET 2.0 Advanced Application Design: Advanced Application Design Authors: Dominic Selly, Andrew Troelsen, Tom Barnaby, Pages: 459, Published: 2005
ASP.NET 2.0 Cookbook Authors: Michael A. Kittel, Geoffrey T. Leblond, Pages: 989, Published: 2005
Microsoft Sharepoint: Building Office 2007 Solutions in C# 2005 Authors: Scot Hillier, Pages: 513, Published: 2007
Pro SharePoint Solution Development Combining .NET, SharePoint, and Office 2007 Authors: Ed Hild, Susie Adams, SpringerLink (Online service, Pages: 0, Published: 2007
2004 IEEE International Symposium on Computer-Aided Control System Design: September 2-4, 2004, the Grand Hotel, Taipei, Taiwan Authors: IEEE International Symposium on Computer Aided Control System Design, IEEE Control Systems Society, Institute of Electrical and Electronics Engineers, European Union Control Association., European Union Control Association, Institute of Electrical and Electronics Engineers, IEEE Control systems society, Chinese Automatic Control Society., Keisoku Jidō Seigyo Gakkai (Japan), Taiwan Ministry of Education, Institute of Electrical, Ministry of Education, Taiwan, R.O.C, Taiwan..Ministry of Education., Chinese Automatic Control Society, Electronics Engineers., CACSD 2004, IEEE International Conference on Control Applications, IEEE International Symposium on Intelligent Control, Pages: 383, Published: 2004
Programming ASP.NET: Building Web Applications and Services with ASP.NET 2.0 Authors: Jesse Liberty, Dan Hurwitz, Pages: 930, Published: 2005

Web:
Share DB Connection in all web user controlers on page - ASP.NET ... Share DB Connection in all web user controlers on page. Last post 09-01-2007 4: 27 PM by Qandil. 4 replies. Sort Posts: ...
Web Parts Connections Overview NET server control, custom control, or user control can be used as a Web Parts ... Manages all connections between controls in the Web Parts zone on a page. ...
Database-Based Authentication for PHP Apps These two variables can only be set in the AddDbUser.php Web page, ... is_inserted() function shares the local connection for transaction control purposes. ...
Encrypting Connection Strings in Web.config | O'Reilly Media Feb 15, 2005 ... You can encrypt almost all the sections in Web.config, ... Articles that share the tag connection:. Database Connection Pooling with Tomcat ...
UltraVNC: Remote Support Software, Remote Support tool, Remote ... Our goal is to make the more powerful, user-friendly and no-brainer free Remote Control software available. UltraVNC is Free and distributed under the terms ...
MacInTouch: timely news and tips about Apple Macintosh, iTunes ... The MacInTouch Home Page is the original Mac news site, providing timely, ... a growing online user database, find recipes based on ingredients on hand, ...
Can't Open OleDb Connection to Access Database It all works great when the .mdb file is local, but when I try to connect to an .mdb file on a network share, the web page displays, "The ...
Using Ruby on Rails for Web Development on Mac OS X You may have changed the database connection, which requires a restart, so restart the ..... All that would happen without needing to reload the page. ...
TidBITS: Mac news for the rest of us Enter the URL to a Web page that supports your tip. Linked text .... The 50 percent discount on all Take Control ebooks to celebrate our 5th anniversary ...
What Is Web 2.0 | O'Reilly Media Therefore, Web 2.0 companies set inclusive defaults for aggregating user data .... one can already see a number of cases where control over the database has ...

Videos:
How To Break Web Software - A look at security vulnerabilities in web software Google TechTalks April 13, 2006 Mike Andrews Mike Andrews is a senior consultant who specializes in software security and leads the web application...
Mac OS Automator: Doing things over and over is over. Google TechTalks June 27, 2006 Sal Soghoian ABSTRACT Mac OS X "Tiger" introduces Automator, a new application that automates anything on your compu...
Long Beach City Council Meeting Long Beach City Council Meeting




Search This Site:










blanks in cookies disappearing

returning a single field from a database

getting server's local time

vs .net

readline interpreting hex 0d as end of line

is this the best way of doing this?

page freezes after adding update panel

unclickable fields inside the "div" border

cant get rss consumption to work

webservices, wcf, wf & wpf

sending an email via a web page in code

how to read filename arguments

advice please

foreach, checkboxlist, session

how do i use split method to parse standard delimited fields ?

query strings

add the radio buttons to the lisbox with some text

object reference error and stored procedure

localhost sending mail

asp.net 2.0 compiling problem

sending email through domino server from asp.net

calendar - hide other month's weeks

i need some class!

how can i get the localizepers_cs sample ?

release build

grouping of type date

export to excel - excel application not showing/displaying

adrotator - trying to display google address in it

application unavailable, .aspx applications not working! help, please!

page locking

  Privacy | Contact Us
All Times Are GMT