PHP Function to Delete an Existing Database

vanithasree
Updated on 22-Jun-2020 13:21:36

158 Views

PHP uses a mysql_query function to delete a MySQL database. This function takes two parameters and returns TRUE on success or FALSE on failure. Its syntax is as follows −Syntaxbool mysql_query( sql, connection );Followings are the parameters used in this function −Sr. No.Parameter & Description1RequiredSQL query to delete a MySQL database2Optionalif not specified, then the last opened connection by mysql_connect will be used.

File Permissions in C#

George John
Updated on 22-Jun-2020 13:21:18

3K+ Views

For File Permission in C#, use the FileIOPermission Class. It controls the ability to access files and folders.The following are the properties of File Permissions class −Sr.No.Methods & Description1AllFilesGets or sets the permitted access to all files.2AllLocalFilesGets or sets the permitted access to all local files.The following are the methods of File Permission class −Sr.No.Methods & Description1AddPathList(FileIOPermissionAccess, String)This method adds access for the specified file or directory to the existing state of the permission2Copy()This method creates and returns an identical copy of the current permission.3GetType()The GetType() method gets the type of the current instance.4ToXml()Creates an XML encoding of the permission ... Read More

Pair Class in C#

Ankith Reddy
Updated on 22-Jun-2020 13:20:45

6K+ Views

The Pair class is the KeyValuePair class that stores a pair of values in a single list with C#.Declare KeyValuePair −var myList = new Liststring, int>>(); Now, add some elements: myList.Add(new KeyValuePair("Laptop", 1)); myList.Add(new KeyValuePair("Desktop System", 2)); myList.Add(new KeyValuePair("Tablet", 3)); myList.Add(new KeyValuePair("Mobile", 4)); myList.Add(new KeyValuePair("E-Book Reader", 5)); myList.Add(new KeyValuePair("LED", 6));Display the KeyValuePair now as shown below −Example Live Demousing System; using System.Collections.Generic; class Program {    static void Main() {       var myList = new List();       // adding elements       myList.Add(new KeyValuePair ("Laptop", 1));       myList.Add(new KeyValuePair ("Desktop System", 2));   ... Read More

Different Privileges Required for Using Views

Lakshmi Srinivas
Updated on 22-Jun-2020 13:20:14

201 Views

Following privileges are required for a different kind of CREATE, REPLACE, DROP, ACCESS, UPDATE etc. of usage of views − CREATE VIEW Privilege − CREATE VIEW privilege is required to create a view. Along with this we must have sufficient privileges, like SELECT, INSERT or UPDATE, for accessing the tables to which the view definition refers. DROP VIEW Privilege − We require DROP VIEW privileges for using OR REPLACE clause, DROP VIEW statement and also for using ALTER VIEW statement. SELECT Privilege − We must have SELECT privileges for selecting from a view. INSERT, DELETE or UPDATE Privileges − Actually for an updateable view ... Read More

Major Activities of an Operating System in Process Management

David Meador
Updated on 22-Jun-2020 13:20:13

7K+ Views

A process is an active program i.e a program that is under execution. It contains the program code, program counter, process stack, registers etc. Process Management deals with processes and the various mechanisms to handle them.The various activities that the operating system performs with regard to process management are mainly process scheduling and context switching. Details about these are given as follows −Process SchedulingThere are many scheduling queues that are used to handle processes. When the processes enter the system, they are put into the job queue. The processes that are ready to execute in the main memory are kept ... Read More

MS-DOS Layered Structure

Ricky Barnes
Updated on 22-Jun-2020 13:19:19

7K+ Views

MS-DOS is an operating system created for personal computers. It was developed by Microsoft. It is a classic example of an operating system with a layered structure. MS-DOS operating system is split into various layers and each of the layers have different functionalities.Layering provides a distinct advantage in the MS-DOS operating system because all the layers can be defined separately and interact with each other as required. Also, it is easier to create, maintain and update the system if it is done in the form of layers. Change in one layer specification does not affect the rest of the layers. ... Read More

Major Activities of an Operating System in Memory Management

Alex Onsman
Updated on 22-Jun-2020 13:18:31

4K+ Views

Memory management plays an important part in the operating system. It deals with memory and the moving of processes from disk to primary memory for execution and back again.Some activities of an operating system with regards to memory management are −Memory AllocationA simple way to allocate memory is to provide the empty memory spaces to incoming processes as required. This can be done using the following algorithms −First-FitThe first available memory space that is large enough for the process purposes is allocated. Searching can start at the beginning or at the point where the last first-fit search ended.Best-FitThe smallest memory ... Read More

Exit Methods in C# Application

radhakrishna
Updated on 22-Jun-2020 13:16:20

12K+ Views

Environment.Exit() methodThe Environment.Exit() method terminates the process and returns an exit code to the operating system −Environment.Exit(exitCode);Use exitCode as 0 (zero) to show that the process completed successfully.Use exitCode as a non-zero number to show an error, for example −Environment.Exit(1) − Return a value 1 to show that the file you want is not presentEnvironment.Exit(2) − Return a value 2 to indicate that the file is in an incorrect format.System.Windows.Forms.Application.ExitThread( )To close a subapplication or current thread in a Windows Form, use theSystem.Windows.Forms.Application.ExitThread( ).private void buttonClose_Click(object sender, EventArgs eventArgs) {    System.Windows.Forms.Application.ExitThread( ); }Read More

Matching Strings with a Wildcard in C#

varma
Updated on 22-Jun-2020 13:15:59

5K+ Views

Commonly used wildcard characters are the asterisk (*). It represents zero or more characters in a string of characters.In the following example asterisk is used to match words that begins with m and ends with e −@”\bt\S*s\b”The following is the complete code −Example Live Demousing System; using System.Text.RegularExpressions; namespace Demo {    public class Program {       private static void showMatch(string text, string expr) {          MatchCollection mc = Regex.Matches(text, expr);          foreach (Match m in mc) {             Console.WriteLine(m);          }     ... Read More

Managed Code vs Unmanaged Code in C#

Prabhas
Updated on 22-Jun-2020 13:15:33

4K+ Views

Unmanaged CodeApplications that are not under the control of the CLR are unmanagedThe unsafe code or the unmanaged code is a code block that uses a pointer variable.The unsafe modifier allows pointer usage in unmanaged code.Let us see the example −Examplestatic unsafe void Main(string[] args) {    int var = 20;    int* p = &var;    Console.WriteLine("Data is: {0} ", var);    Console.WriteLine("Address is: {0}", (int)p);    Console.ReadKey(); }Managed CodeManaged code is a code whose execution is managed by Common Language Runtime. It gets the managed code and compiles it into machine code. After that, the code is executed.The ... Read More

Advertisements