No lesson this afternoon, I played a computer, I remembered the problem that I didn't solve yesterday, my heart is a bit uncomfortable, I have to solve the problem. ^ _ ^.
I uninstall the Study instance of yesterday, and carefully studied the self-propped file, according to the instructions, I created a log file called MSDELOG.LOG in the C drive, and then type "Setup SAPWD in the command prompt line" = Chengbo / L * V c: /msdelog.log securitymode = SQL "After the installation is completed, the last record of the log file is successful, then it should be fine. To start -> administrative tools -> services, start the MSSQLServer service, then find the computer with SQL Server Service Manager, green, indicating that it is running.
The installation is successful, but there is no Northwind database. The Internet is searched. In the MSDN discovers the solution, the MSDE does not bring the paradiction of Northwind, follow the instructions I downloaded MFC_Database_dbsamputil.exe, decompressed three files: Northwind.sql, Pubs.SQL, Sampdbinstall.exe. Double-click Sampdbinstall.exe, and fill in (local) point OK in the TextBox after Server. After successful, open vs.net, found the Northwind and Pubs database just installed in the SQL Server in the Server Explorer, and now test whether the test is normal. Create a new WebForm, change the following code in the CS file:
Private Void Page_Load (Object Sender, System.EventArgs E)
{
SqlConnection
Conn
= New SqlConnection ("Server = (local); UID = SA; PWD = Chengbo; connection timeout = 5; Database = northwind;");
Try
{
SqlDataAdapter Da = New SqldataAdapter ("Select Firstname, Lastname from Employees,
Conn
);
DataSet DS = New Dataset ();
Da.fill (DS);
DataGrid1.datasource = DS;
DataGrid1.databind ();
}
Catch (Exception EX)
{
Response.write (ex.totring ());
}
}
Start the browser after pressing F5, displaying the table below:
Firstname
Lastname
Nancy
Davolio
Andrew
Fuller
Janet
LEVERLING
Margaret
PEACOCK
Steven
BUCHANAN
Michael
Suyama
Robert
King
Laura
Callahan
ANNE
Dorthh
Everything is normal, get it! I hope this article helps friends who meet the same problem.