C#: Execute .bat files
This code will create a batch file and run it.
Be sure to include the following classes:
System.IO; //writes file
System.Diagnostics; //runs process
Cookies!
The basics - cookies in .Net
uses System.Web
Execute SQL DTS Packages from .Net
This example shows you how to execute a DTS package from C#.
- Add a reference to the following DLL in .Net (change according to your SQL installation location):
C:\Program Files\Microsoft SQL Server\80\Tools\Binn\dtspkg.dll
- Add to your clas...
Exposing Classes to Your Objects
Exposing your class to other objects is easy.
This example shows you how to create an instance of an object having the ability utilize the object throughout your class.
New Line (Multiline Textbox)
When creating a multi-line textbox (as an example), you can create a new line (carriage return / line feed) in 2 ways:
One is similar to Javascript: \r\n
You can also use the System.Environment.NewLine
Strings: Replace method
Use the following function to replace these -> ' with the SQL equivalent, for inserts/updates.
User Control Example
Here is a quick example of using User Controls as a method of including repetitive information for each page (e.g. a page header).
Using CDO to Send Email in .Net
- Create a new Windows App (C#)
- Add reference to CDO (using CDO)
- Add the following text boxes:
- txtTo (message to)
- txtFrom (message from)
- txtSubject (message subject)
- txtBody (message body)
- txtAttachFile (filename a...