The previous installation deployment of VS.NET is just a simple packaging application, often packed in the installer together when making a installation package, and can also customize a user interface to allow users to install Enter the configuration information of the database (server name, database name, login user, password), create a database with the installer, and configure the application configuration file. Such as: Connect the string.
First, first look at an introduction to custom installations
Custom MSI installation
Second, download the program example provided above, load it directly into your own solution, you can use it. The script files you want to modify are just the script files under the script directory. (Modified to create a script you want to create), add The main output of this program is in the 'application folder' of the installer. (It is best to create two folders in this folder, bin and install, bin put your application's output file, install CustomSteps Output file)
Third. Right click on the installer item ==> View ==> User interface
Right-click 'Start' ==> Add Dialog ==> Text Box (a), moved to the second position.
Edit the properties of text box (a):
Binnertext: Database parameters
BodyText: Please configure some parameters for creating a database, each item must be filled out.
Edit1Label: Server Name:
Edit1Property: Server_Name
Edit1Value: [ComputerName]
Edit2Label: The name of the database to be created:
Edit2Property: Database_name
Edit2Value: // You can fill in a default database name, or you can not fill
Edit3Label: Username:
Edit3Property: User_name
Edit3Value: SA
Edit4Label: Password:
Edit4Property: Password
Then generate the installer ... OVER
----------------------------------
Also provide a function that automatically generates data scripts in a database
#Region Generates scripts in the data table PUBLIC STATIC STRING CREATEDAScript (String Tablename) {
Bool isidentity = false; // Is there a laser (self-increment) string commandText = String.Format ("Select C.Name, Biaoshi = ColumnProperty (C.ID, C.NAME, 'ISITENTITY'), T. Name " " from syscolumns c inner join systemypes t on c.xUsertype = T.XUSERTYPE " " where c.id = Object_ID ('{0}') ", TABLENAME);
DataTable FieldList = dbhelper.executedataTable (CommandType.text, CommandText); // This method you write if you write 吧 (FieldList == Null || FieldList.Rows.count == 0) Return ""
String getValue = string.format ("SELECT * FROM [{0}]", TABLENAME);
DataTable DT = dbhelper.executedtatable (CommandType.Text, getValue); if (DT == Null || DT.ROWS.COUNT == 0) Return "; string middle ="
For (int J = 0; j
FieldString = "[" FieldName "],"; valueString = "'" DR [FieldName] "',";} fieldstring = fieldString.Substring (0, FieldString.Length-1); valueString = valueString. Substring (0, valueString.Length-1);
Middle = string.format ("/ N INSERT INTO [{0}] ({1}) / n values ({2})", Tablename, FieldString, ValueString;
String script = ""; if (isidentity) script = string.format ("Set Identity_Insert [{0}] ON / N" MIDDLE "/ N / NSET Identity_INSERT [{0}] OFF" "/ n Go", Tablename, Middle); Else Script = "/ n" middle;
Return script;} #ENDREGION
2005-3-13 11:12 by cuimeteor
ASP.NET Settings IE Printing Both Act (Fine) (Turn)
The most headache in ASP.NET may be printed. For this problem, I have to be white. There are also many codes on the Internet, but there will always be some problems. According to my own actual experiment, I can't use it, and I can't find an error message such as an object. Here is two practical methods: one. Modify IE Print Setting