-------------------- Windows Phone 7 Mobile Phone development,. Net training, and hope to communicate with you! ----------------------
In. net, ado.net is used to optimize database access.
Sqlconnection: the class used to establish a connection with the SQL Server server, indicating the opened database connection.
The connectionsetting attribute is used to set the string used to open the SQL Server database.
In the string, "server" indicates the name or network address of the SQL server instance to be connected, and "local" indicates that the instance is connected to a local computer.
User ID indicates the user name for SQL Server login
PWD indicates the logon password.
Database indicates the name of the database to be connected.
Then we can establish a database connection.
string ConStr = "server=(local);user id=ysm;Pwd=;DataBase=db_01";SqlConnection con = new SqlConnection(ConStr);
In this way, the connection to the database is realized.
-------------------- Windows Phone 7 Mobile Phone development,. Net training, and hope to communicate with you! ---------------------- For details, please refer to: http://net.itheima.com/
-------------------- Windows Phone 7 Mobile Phone development,. Net training, and hope to communicate with you! ----------------------
In. net, ado.net is used to optimize database access.
Sqlconnection: the class used to establish a connection with the SQL Server server, indicating the opened database connection.
The connectionsetting attribute is used to set the string used to open the SQL Server database.
In the string, "server" indicates the name or network address of the SQL server instance to be connected, and "local" indicates that the instance is connected to a local computer.
User ID indicates the user name for SQL Server login
PWD indicates the logon password.
Database indicates the name of the database to be connected.
Then we can establish a database connection.
string ConStr = "server=(local);user id=ysm;Pwd=;DataBase=db_01";SqlConnection con = new SqlConnection(ConStr);
In this way, the connection to the database is realized.
-------------------- Windows Phone 7 Mobile Phone development,. Net training, and hope to communicate with you! ---------------------- For details, please refer to: http://net.itheima.com/