Opening a database connection in Page_Load() fails


I've created a SqlConnection object in Page_Load() method of a Web form app and found that a call to 'open' method on the object failed at run-time; however this call works well in the Page_Init() method. Is this a known fact that a database connection cannot be opened from a Page_Load method?

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!