Usage of database connection words in web.config
2003-01-15 09:37:32
In the setting of the web program in ASP.NET, we must use Web.config to store database connection words. In fact, this is a good practice, because you can save us a lot of troubles can also help us avoid unnecessary misplaced Yes, I will do this. It records this information through XML. The specific is to record in
Vb.netdim ooledbconnection as oledb.oledbconnectiondim sconnstring as string = _ "provider = microsoft.jet.Oledb.4.0;" & _ "data source = c: /mypath/myjet.mdb;" & _ "user id = admin;" & _ "Password =" oOleDbConnection = New OleDb.OleDbConnection (sConnString) oOleDbConnection.Open () Oracle OLE DB of 'VB.NETDim oOleDbConnection As OleDb.OleDbConnectionDim sConnString As String = _ "Provider = OraOLEDB.Oracle;" & _ "Data Source = MyOracleDB; "& _" User ID = myUsername; "& _" 'VB.NETDim Password = myPassword "oOleDbConnection = New OleDb.OleDbConnection (sConnString) oOleDbConnection.Open () SQL Server OLE DB of oOleDbConnection As OleDb.OleDbConnectionDim sConnString As String = _ "Provider = sqloledb;" & _ "Data Source = myServerName;" & _ "Initial Catalog = myDatabaseName;" & _ "User Id = myUsername;" & _ "Password = myPassword" oOleDbConnection = New OleDb.OleDbConnection (sconnstring) ooledbconnection.open () SYBA 'VB.NETDim se ASE OLE DB of oOleDbConnection As OleDb.OleDbConnectionDim sConnString As String = _ "Provider = Sybase ASE OLE DB Provider;" & _ "Data Source = MyDataSourceName;" & _ "Server Name = MyServerName;" & _ " Database = MyDatabaseName; "& _" User ID = myusername; "& _" password = mypassword "ooledbconnection =