-----------------------------------------------------------

New Message on BDOTNET

-----------------------------------------------------------
From: Manivannanvp
Message 4 in Discussion


Hi Balaji,
 
You can store the connections string in Web.config
rather than storing in Application.  If you put the connection open
code inside a try..catch block, you will
be able to capture the
exception.   
 
 oConn.ConnectionString =
ConfigurationSettings.AppSettings("conStrProdDB")
 
 try
   Dim state =
oConn.State.ToString()
   If (state = "Closed")
Then
       oConn.Open()
   End
If
 
catch ex as exception
    Errorpanel.visible = true
    Errorpanel.text = "Error opening the
connection"
end
try

Note:

   Here the Errorpanel is a label box, where u can throw all ur
errors.
 
rgds,
mani.v


From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of
BalajiKrishnan
Sent: Wednesday, September 14, 2005 10:58
PM
To: BDOTNET
Subject: asp vs aspx -
Doubt




  
  
    
    New Message on BDOTNET
  
    

asp vs aspx
  - Doubt


  
    
    
      Reply

      
        
          
          
             
            Reply to Sender   Recommend 
            Message 1 in Discussion
            
    
      
        
          
          
            From: BalajiKrishnan 
          
            

              Hi All,
               
              I have a simple question.
               
              I have a asp page which gets the connectionstring information
              from a Application Object and check the Database connection is
              open or not
               
              ObjConn.Open Application("ITAConnectionString")
 If
              Err.number<>0 Then
  strErr = 
              "Application unable to connect to database."
 Else
              ......
               
              I need to migrate this to aspx page, can I write the same
              logic in aspx page or do I need to create a Project and write the
              code in cs file.
               
              Balaji
View other groups in this
  category. 



-----------------------------------------------------------

To stop getting this e-mail, or change how often it arrives, go to your E-mail 
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw

Need help? If you've forgotten your password, please go to Passport Member 
Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help

For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact

If you do not want to receive future e-mail from this MSN group, or if you 
received this message by mistake, please click the "Remove" link below. On the 
pre-addressed e-mail message that opens, simply click "Send". Your e-mail 
address will be deleted from this group's mailing list.
mailto:[EMAIL PROTECTED]

Reply via email to