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 […]
Regular expression for validating phone numbers
The following regular expression will validate phone numbers in all well known formats, such as: 555-12-34555 12 34555 1234555 12-345551234(012) 555-12-34(012) 555 1234+1 (012) 555-12-34+1 (012) 5551234 …and many other similar formats. /^(\+\d)*\s*(\(\d{3}\)\s*)*\d{3}(-{0,1}|\s{0,1})\d{2}(-{0,1}|\s{0,1})\d{2}$/
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.
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: […]
How do I change the timeout limit for my PHP code?
If you would like to overwrite the script execution timeout limit defined in php.ini, you can do that directly from your PHP code using the following line: // Set it to no-limitset_time_limit(0); Of course you can as well set it to any time limit in seconds. The default time limit is 30 seconds.
A potentially dangerous Request.Form value was detected from the client
If you are receiving the A potentially dangerous Request.Form value was detected from the client error while a PostBack occurs (submitting a form, for instance) it is most likely because in the PostBack content, there are HTML or HTML-like tags. This is ASP.NET’s defense mechanism that prevents the users of a website to try and […]