Author: unknown. Please contact me quickly. We must use WEB in the settings of the Web program in asp.net. config to store database connection words. in fact, this is a good practice, because it saves us a lot of trouble and helps us avoid unnecessary misplacement. it records this information through XML. specifically in...
Author: unknown. Please contact me quickly. We must use WEB in the settings of the Web program in asp.net. config to store database connection words. in fact, this is a good practice, because it saves us a lot of trouble and helps us avoid unnecessary misplacement. it records this information through XML. specifically in...
Author: Unknown please contact me quickly
In the WEB program settings in asp.net, we must use Web. config to store database connection words. in fact, this is a good practice, because it saves us a lot of trouble and helps us avoid unnecessary misplacement. it records this information through XML. specifically in ....Here, an ORACLE example is as follows:
Persist Security Info = False; Password = blah; User ID = greg; Data Source = 7d; "/>
Integrated security = SSPI; persist security info = False; workstation id = TH03D374;
Packet size = 4096 "type =" codeph "text ="/codeph "/>
In your application, you only need to write it like this, as shown below:
String conn = ConfigurationSettings. deleettings ["ORACLEConnectionString"];
OleDbConnection myConnection = new OleDbConnection (conn );
Is it easy? You don't have to enter the same connection word every time, or remember the nasty information. You just need to enter a memorable name. Well, I will give some other connection words below:
MYSQL connection words:
ConnectionString = "Data Source = localhost;" +
"Database = mySQLDatabase;" +
"User ID = myUsername;" +
"Password = myPassword;" +
"Command Logging = false ";
Ole db:
Ibm as/400 OLE DB
'Vb. NET
Dim oOleDbConnection As OleDb. OleDbConnection
Dim sConnString As String = _
"Provider = IBMDA400.DataSource. 1 ;"&_
"Data source = myAS400DbName ;"&_
"User Id = myUsername ;"&_
"Password = myPassword"
OOleDbConnection = New OleDb. OleDbConnection (sConnString)
OOleDbConnection. Open ()
The
'Vb. NET
Dim oOleDbConnection As OleDb. OleDbConnection
Dim 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
'Vb. NET
Dim oOleDbConnection As OleDb. OleDbConnection
Dim sConnString As String = _
"Provider = OraOLEDB. Oracle ;"&_
"Data Source = MyOracleDB ;"&_
"User ID = myUsername ;"&_
"Password = myPassword"
OOleDbConnection = New OleDb. OleDbConnection (sConnString)
OOleDbConnection. Open ()
SQL Server OLE DB
'Vb. NET
Dim oOleDbConnection As OleDb. OleDbConnection
Dim sConnString As String = _
"Provider = sqloledb ;"&_
"Data Source = myServerName ;"&_
"Initial Catalog = myDatabaseName ;"&_
"User Id = myUsername ;"&_
"Password = myPassword"
OOleDbConnection = New OleDb. OleDbConnection (sConnString)
OOleDbConnection. Open ()
Sybase ASE OLE DB
'Vb. NET
Dim oOleDbConnection As OleDb. OleDbConnection
Dim sConnString As String = _
"Provider = Sybase ase ole db Provider ;"&_
"Data Source = mydomaincename ;"&_
"Server Name = MyServerName ;"&_
"Database = MyDatabaseName ;"&_
"User ID = myUsername ;"&_
"Password = myPassword"
OOleDbConnection = New OleDb. OleDbConnection (sConnString)
OOleDbConnection. Open ()
SQL Server in System. Data. SqlClient
SqlConnection oSQLConn = new SqlConnection ();
OSQLConn. ConnectionString = "Data Source = (local);" +
"Initial Catalog = mySQLServerDBName;" +
"Integrated Security = SSPI ";
OSQLConn. Open ();
This is all written in VB. NET. I hope to help my friends who use VB to write ASP. NET.