Upload control: Specify directory, default size 4m; HTML control, convert to server control; string destdir = server.mappath ("./ Upload"); string filename = system.io.path.GetFileName (file1.postedfile.FileName String destPath = system
References of external controls: Controls developed under .NET; originally developed COM components; tree controls; ExpandLevel defaults; selectexpands properties, click Expand; Tabstrip Multipage
Customize the user control: Production with ordinary pages; provide public properties;
Class operation:
Database operations: SqlConnection objConn = new SqlConnection (); // establish a connection; SqlCommand objCommand = new SqlCommand (); // create an object; SqlDataReader bojReader = new SqlReader (); ExecuteScalar objExecute = new ExecuteScalar (); // first record established connection: string connectString = "data source = .; initial catalog = XXX; user id = sa; password =; Pooling = true; max pool size = 100" SqlConnection objConn = new SqlConnection (connectString); objConn.Open (); Response .Write ("ok");
Objconn.close (); string cmdtext = "sql statement" sqlcommand objcommand = new SQLCOMMAND (COMTEXT, OBJCONN); objcommand.executenonQuery ();
SqlDataReader Objreader = objcommand.executeReader (); while (objreader.read ()) {response.write (ObjReader ["UserName"]. TOSTRING ());}