The following line will allow you to dump a MySQL database from the current machine to another machine, for as long as you have access to the dd command on the remote machine: mysqldump -u USERNAME-HERE -p’PASSWORD-HERE’ DB-NAME-HERE | ssh [email protected] “dd of=/mysql/$(date +’%d-%m-%y’)”
How do I prevent a console application from closing immediately?
You have two options.You run the application without debugging (instead of F5 pressCTRL+F5). Or, if you don’t want to run the application without the debugger, at the end of the application code add: Console.ReadLine() Then you end the program by pressing Enter.
How to import the content of a CSS file into another CSS file
If you would like to place the content of a CSS file into another CSS file, copying and pasting is not the only way you can do it. You can easily use @import to include all the content of an existing CSS file into your current CSS file: @import “myOtherStylesheet.css“;
How to find duplicate rows using SQL
The following SQL query will return all the rows that have a duplicate value for the column someColumn. The number of duplicates is stored in the OccurCount variable. SELECT someColumn COUNT(someColumn) AS OccurCount FROM someTable GROUP BY someColumn HAVING (COUNT(someColumn) > 1);
How to get all logical drives on a system?
By calling a static method from System.Environment called GetLogicalDrives(). This returns a string array that you can easily iterate.Suppose you have a ListBox and a button: private void btnPopulate_Click(object sender, System.EventArgs e) { // Store in a string array string[] drives = Environment.GetLogicalDrives(); // Loop into the string array foreach(string strDrive in drives) { // Add […]
At compile I get error CS0138: A using namespace directive can only be applied to namespaces
You are trying to designate a class instead of a namespace for the using statement.For example: using System.Console; This is not correct because the using statement only works with namespaces, while Console is a class.
WhoIs function for domain-name info
This function returns the WhoIs string for the passed domain name (such as the domain-name owner and nameservers) by opening a socket to a WhoIs server.
Can I use MySQL with C#?
Yes, you can use MySQL with C#.You can connect to the database by using ODBC driver and the System.Data.Odbc namespace. Search with Google for tutorials on how to connect to the database as there are some on the web.Here is one:http://www.devhood.com/tutorials
How to swap two numbers without using a third variable
Using pointers you can easily swap two variables without using an additional variable to store a temporary value. This is because instead of swapping values, you can swap addresses, as shown in this function: void SwapSmart(int * a, int * b){*a = *a xor *b;*b = *b xor *a;*a = *a xor *b;}
How do I stop the form from closing / How do I prompt the user to confirm the closing of the application when he presses the X button?
There are a few reasons why you may want this, in some applications, for example, you may want to ask the user if he wants to save the work before closing. You can easily do this by handling the form’s Closing event.In the following example we stop a form named Form1 from closing when clicking the ‘X’ shaped button: […]