Opening a database connection in Page_Load() fails - Programmers Heaven

Howdy, Stranger!

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

Categories

Opening a database connection in Page_Load() fails

tkotatkota Posts: 1Member
Hello,

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?

Thanks,
TK
Sign In or Register to comment.