I have collections of JAVA 1z0-808 Dumps , Download the same from below link,
https://drive.google.com/drive/folders/16WkLcKstFq2n5Ri3jzcK2esFwohxzEnH?usp=sharing

CREATE PROCEDURE dbo.StoredProcedure1 /* ( @parameter1 datatype = default value, @parameter2 datatype OUTPUT ) */ AS /* SET NOCOUNT ON */ RETURN
CREATE FUNCTION dbo.Function1 ( /* @parameter1 datatype = default value, @parameter2 datatype */ ) RETURNS /* datatype */ AS BEGIN /* sql statement ... */ RETURN /* value */ END
IF OBJECT_ID('SalesHistory') IS NOT NULLDROP TABLE SalesHistory
CREATE TABLE [dbo].[SalesHistory]
(
[Product] [varchar](10) NULL,
[SaleDate] [datetime] NULL,
[SalePrice] [money] NULL
)
GO
INSERT INTO SalesHistory(Product, SaleDate, SalePrice)
SELECT 'Computer','1919-03-18 00:00:00.000',1008.00
UNION ALL
SELECT 'BigScreen','1927-03-18 00:00:00.000',91.00
UNION ALL
SELECT 'PoolTable','1927-04-01 00:00:00.000',139.00
UNION ALL
SELECT 'Computer','1919-03-18 00:00:00.000',1008.00
UNION ALL
SELECT 'BigScreen','1927-03-25 00:00:00.000',92.00
UNION ALL
SELECT 'PoolTable','1927-03-25 00:00:00.000',108.00
UNION ALL
SELECT 'Computer','1919-04-01 00:00:00.000',150.00
UNION ALL
SELECT 'BigScreen','1927-04-01 00:00:00.000', 123.00
UNION ALL
SELECT 'PoolTable','1927-04-01 00:00:00.000', 139.00
UNION ALL
SELECT 'Computer','1919-04-08 00:00:00.000', 168.00
;WITH SalesCTE(Product, SaleDate, SalePrice, Ranking)
AS
(
SELECT
Product, SaleDate, SalePrice,
Ranking = DENSE_RANK() OVER(PARTITION BY Product, SaleDate,SalePrice ORDER BY NEWID() ASC)
FROM SalesHistory
)
DELETE FROM SalesCTE
WHERE Ranking > 1Because a CTE acts as a virtual table, I am able to process data modification statements against it, and the underlying table will be affected. In this case, I am removing any record from the SalesCTE that is ranked higher than 1. This will remove all of my duplicate records.
SELECT * FROM SalesHistory
Introduction
· Menus make it easy to access the functionality and take less space and make your application look more organized.
· Menus contain top – level items and drop – down items.
o Top – level items: all visible items are top-level menus
o Drop – down items: non – visible items are dropdown menus and also call it as child menus of a top – level menu.
Classes required to create a Menu
1. MenuStrip:
· This control is like a container will hold all the top – level menus going to be created.
· This control will be available under “System.Windows.Forms” namespace.
Decalration of a MenuStrip control
Import the namespace – using System.Windows.Forms
// Declare the menustrip object.
MenuStrip menuItems = new MenuStrip();
2. ToolStripMenuItem :
· This class is used to create menu items like top – level or drop – down menus going to be created.
· It can also represent a submenu of another ToolStripMenuItem object. ToolStripMenuItem objects are viewed by the user, whereas a MenuStrip object simply establishes a container where menu items appear.
· This class will be available under “System.Windows.Forms” namespace.
Decalration of a MenuItem class
Menu can be created using a Text or Image or both.
// Take a ToolStripMenuItem to add the menu item with string.
ToolStripMenuItem menuItem = new ToolStripMenuItem(“File”);
Or
// Take a ToolStripMenuItem to add the menu item with Image.
ToolStripMenuItem menuItem = new ToolStripMenuItem(new Bitmap(“path of the image to load”));
Or
// Take a ToolStripMenuItem to add the menu item with Strng and Image.
ToolStripMenuItem menuItem = new ToolStripMenuItem((“File”, new Bitmap(“path of the image to load”));
These are the main classes to create any kind of menu.
Using this information will know how to create dynamic menus.
Program: Going to create dynamic simple menus
Output: looks like this
File Edit Help - Top – level menus
New Copy AboutMe - drop – down menus
Open Cut ContactUs
Exit Pate Help
Step-By-Step code explanation to create a dynamic menu
1. Define menus required.
Note: There will be so many ways to approach declaring the menu items but here I used by taking dictionary object.
// Create Main menu and child menus in a ditcionary object as key pair values.
Dictionary<string, string[]> displayMenus = new Dictionary<string, string[]>();
// Define the child menus based on the each main menu on the basis of key.
displayMenus.Add(“File”, new string[] { “New”, “Open”, “Exit” });
displayMenus.Add(“Edit”, new string[] { “Copy”, “Cut”, “Paste” });
displayMenus.Add(“Help”, new string[] { “AboutMe”, “ContactUs”, “Help” });
2. Write a function to create menus by taking the dictionary object as parameter.
///
/// This method will create a menu based on the menus
/// and it’s submenus defined.
///
///
/// Menus and it’s submenus in a dictioanry object
///
///
/// Returns a collection of a toolstripmennu items.
///
private List<ToolStripMenuItem> CreateMenu(Dictionary<string, string[]> displayMenus)
{
// Declare ToolStripMenuItem object.
List<ToolStripMenuItem> menuItems = new List<ToolStripMenuItem>();
// Loop through all main menus.
foreach (KeyValuePair<string, string[]> menu in displayMenus)
{
// Take a ToolStripMenuItem to add the menu item.
ToolStripMenuItem menuItem = new ToolStripMenuItem(menu.Key);
// Set a name to the menu.
menuItem.Name = menu.Key;
// Create child menu items for a menu item.
this.CreateChildMenus(menuItem, menu.Value);
switch (menu.Key)
{
case “File”:
case “Edit”:
// This is by default.
// menuItem.Alignment = ToolStripItemAlignment.Left;
break;
case “Help”:
menuItem.Alignment = ToolStripItemAlignment.Right;
break;
}
// Add each menu item to the menu strip item.
menuItems.Add(menuItem);
}
return menuItems;
}
3. Write a function to create child menus by taking the parent menu and the child menus going to be created.
///
/// Thsi method will create a child menus of a menu item.
///
///
/// Parent menu item to add child menu items.
///
///
/// Child menu items going to be created.
///
private void CreateChildMenus(ToolStripMenuItem parentMenuToAddChildMenus, string[] childMenus)
{
// Loop through all child menus.
foreach (string childMenu in childMenus)
{
// Take a ToolStripMenuItem to add the menu item.
ToolStripMenuItem childMenuItem = new ToolStripMenuItem(childMenu);
// Set a name to the menu.
childMenuItem.Name = childMenu;
// Hnadle the event for the menu created.
childMenuItem.Click += new EventHandler(ChildMenu_Click);
// Add each child menu to its parent menu item.
parentMenuToAddChildMenus.DropDown.Items.Add(childMenuItem);
}
}
4. Write an event handler common to all the menu items.
///
/// This method will handle the click event for each menu.
///
/// Tool strip menu item.
/// Event args.
private void ChildMenu_Click(object sender, EventArgs e)
{
ToolStripMenuItem sourceMenuItem = (ToolStripMenuItem)sender;
string selectedMenu = string.Empty;
// Selected menu item
switch (sourceMenuItem.Name)
{
case “New”:
// Required statements here.
selectedMenu = sourceMenuItem.Text;
break;
case “Open”:
// Required statements here.
selectedMenu = sourceMenuItem.Text;
break;
case “Exit”:
// Required statements here.
selectedMenu = sourceMenuItem.Text;
break;
case “Edit”:
// Required statements here.
selectedMenu = sourceMenuItem.Text;
break;
case “Copy”:
// Required statements here.
selectedMenu = sourceMenuItem.Text;
break;
case “Paste”:
// Required statements here.
selectedMenu = sourceMenuItem.Text;
break;
case “AboutMe”:
// Required statements here.
selectedMenu = sourceMenuItem.Text;
break;
case “ContactUs”:
// Required statements here.
selectedMenu = sourceMenuItem.Text;
break;
case “Help”:
// Required statements here.
selectedMenu = sourceMenuItem.Text;
break;
}
if (!string.IsNullOrEmpty(selectedMenu))
{
MessageBox.Show(string.Concat(
selectedMenu,
” feature is under development “));
}
}
5. add the created menu items collection to the MenuStrip object
Conclusion:
· This is the procedure to create dynamic menus in windows application.
· If you want to create your custom type dynamic menus then modify the code according to your needs in a dictionary object as defined in step1.
Note: This is just a sample code to guide you how a menu can be created.