Some operations for .NET databases:

xiaoxiao2021-03-06  68

I. About the database: 1. SQL Server connection string: Simple connection as follows: string strconn = "server = localhost; uid = sa; pwd =; dataBase = PUBS"; of course, the standard can be like This: string strconn = "Workstation id = shipfi; packet size = 4096; user ID = sa; pwd =; data source = shipfi; persist security info = false; initial catalog = pubs; 2. Other database connections: Simple The connection is as follows: string strconn = "provider = microsoft.jet.Oledb.4.0; data source =" server.mappath ("ASP_NET / ASP_NET.MDB"); the standard is as follows: String strconn = "Jet OLEDB: Global Partial Bulk Ops = 2; Jet OLEDB: Registry Path =; Jet OLEDB: Database Locking Mode = 1; Data Source = "D: /code/flow/flow/flow.mdb"; Mode = Share Deny None; Jet OLEDB: Engine Type = 5; Provider = "Microsoft.Jet.OLEDB.4.0"; Jet OLEDB: System database =; Jet OLEDB: SFP = False; persist security info = False; Extended Properties =; Jet OLEDB: Compact Without Replica Repair = False; Jet OLEDB: Encrypt Database ASE = false; jet oledb: create system database = false; jet oledb: do't copy locale on compact = false; user ID = admin; jet oledb: global bulk transactions = 1 "3. Global save database connection: Yes Place it under the web.config file.

Then take the next time the connection parameters can be taken directly: add the following: The next time you take it out in the file: String strconfigurationStting.configuration.configurationSettings.AppSettings ["SqlConnectionstring"]; Second, some operations on the database: 1. SqlConnection SQLCommand SqlDataReader See: Http://blog.9cbs.net/shipfi/archive/2004/11/22/190969.aspx 2.sqlconnection SqlDataAdapter DataSet See: http://blog.9cbs.net/shipfi/archive/2004/11 / 24/193697.aspx 3. SqlConnection SQLCommand for data for INSERT, UPDATE, DELETE operation. 4. SqlConnection PowerDataGrid.

转载请注明原文地址:https://www.9cbs.com/read-88093.html

New Post(0)