ListDictionary Class in C#

AmitDiwan
Updated on 16-Dec-2019 08:11:12

405 Views

The ListDictionary class implements IDictionary using a singly linked list. It is recommended for collections that typically include fewer than 10 items.Following are the properties of ListDictionary class −Sr.NoProperty & Description1CountGets the number of key/value pairs contained in the ListDictionary.2IsFixedSizeGets a value indicating whether the ListDictionary has a fixed size.3IsReadOnlyGets a value indicating whether the ListDictionary is readonly.4IsSynchronizedGets a value indicating whether the ListDictionary is synchronized (thread safe).5Item[Object]Gets or sets the value associated with the specified.6KeysGets an ICollection containing the keys in the ListDictionary.7SyncRootGets an object that can be used to synchronize access to the ListDictionary.8ValuesGets an ICollection containing the ... Read More

Index of First Occurrence in String Collection in C#

AmitDiwan
Updated on 16-Dec-2019 08:03:56

197 Views

To get the index of first occurrence in StringCollection, the code is as follows −Example Live Demousing System; using System.Collections.Specialized; public class Demo {    public static void Main() {       StringCollection strCol = new StringCollection();       strCol.Add("Accessories");       strCol.Add("Books");       strCol.Add("Electronics");       strCol.Add("Books");       Console.WriteLine("StringCollection elements...");       foreach (string res in strCol) {          Console.WriteLine(res);       }       strCol.Insert(2, "Headphone");       Console.WriteLine("StringCollection elements...UPDATED");       foreach (string res in strCol) {          Console.WriteLine(res); ... Read More

Get Enumerator for Entire ArrayList in C#

AmitDiwan
Updated on 16-Dec-2019 07:59:23

124 Views

To get an enumerator for the entire ArrayList in C#, the code is as follows −Example Live Demousing System; using System.Collections; public class Demo {    public static void Main(String[] args) {       ArrayList list1 = new ArrayList();       list1.Add("A");       list1.Add("B");       list1.Add("C");       list1.Add("D");       list1.Add("E");       list1.Add("F");       list1.Add("G");       list1.Add("H");       list1.Add("I");       Console.WriteLine("Elements in ArrayList1...");       foreach (string res in list1) {          Console.WriteLine(res);       }   ... Read More

MySQL Query to Fetch Records Before Current Date Plus 2 Weeks

AmitDiwan
Updated on 16-Dec-2019 07:57:57

769 Views

For this, use the below syntax −select * from yourTableName where yourColumnName < DATE_ADD(CURDATE(), INTERVAL 2 WEEK);Note: The current date is as follows −mysql> select curdate(); +------------+ | curdate()  | +------------+ | 2019-10-20 | +------------+ 1 row in set (0.00 sec)Let us first create a table −mysql> create table DemoTable1607    -> (    -> ShippingDate date    -> )    -> ; Query OK, 0 rows affected (0.58 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1607 values('2019-10-20'); Query OK, 1 row affected (0.12 sec) mysql> insert into DemoTable1607 values('2019-11-04'); Query OK, 1 row affected ... Read More

Print Screen Using VBA in SAP

Swarali Sree
Updated on 16-Dec-2019 07:51:47

884 Views

If you are using SendKeys then avoid using it. I had used it in the past project and it seems to be inconsistent and error-prone.You can use the below snippet at the top of the module and call it wherever required.Option Explicit Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal _bScan As Byte,  ByVal dwFlags As Long, ByVal dwExtraInfo As Long) Private Const KEYEVENTF_KEYUP = &H2 Private Const VK_SNAPSHOT = &H2C Private Const VK_MENU = &H12 Sub PrintScreen()     keybd_event VK_SNAPSHOT, 1, 0, 0  End Sub

Taking Backup of Schema in SAP HANA

Govinda Sai
Updated on 16-Dec-2019 07:50:51

432 Views

It is always recommended to back up your critical systems.ExampleFollowing SQL command can be used to export schema in HANA:EXPORT "SOURCE_SCHEMA_NAME".* AS BINARY INTO '/tmp/DESTINATION SCHEMA NAME' WITH    REPLACE;This can also be directly zipped to Linux as below:tar -czf SOURCE_SCHEMA.tgz /tmp/DESTINATION_SCHEMA/

Finding Location of Uploaded File Using SAP GUI Upload

Lakshmi Srinivas
Updated on 16-Dec-2019 07:44:17

819 Views

When you upload a file using the gui_upload function, the file is not uploaded to the Application server. The file is read from presentation layer to an internal table.ExampleFollowing code can be used to call a gui_upload function to read the file to an internet table:lv_filename = p_filebp. CLEAR lt_data_tab. IF NOT lv_filename IS INITIAL.   CALL FUNCTION 'GUI_UPLOAD'     EXPORTING       filename = lv_filename     TABLES       data_tab = lt_data_tab     EXCEPTIONS       file_open_error = 1       OTHERS = 17.   IF sy-subrc 0.     EXIT. ... Read More

Implement Harmonic Mean and Quadratic Mean in MySQL

AmitDiwan
Updated on 16-Dec-2019 07:43:05

149 Views

Let us first create a table −mysql> create table DemoTable1606    -> (    -> Value int    -> ); Query OK, 0 rows affected (0.55 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1606 values(5); Query OK, 1 row affected (0.10 sec) mysql> insert into DemoTable1606 values(10); Query OK, 1 row affected (0.12 sec)Display all records from the table using select statement −mysql> select * from DemoTable1606;This will produce the following output −+-------+ | Value | +-------+ |     5 | |    10 | +-------+ 2 rows in set (0.00 sec)Here is the ... Read More

Combining Fields in CDS View in SAP ABAP

karthikeya Boyini
Updated on 16-Dec-2019 07:42:39

3K+ Views

With the use of SAP ABAP 7.5, you can make use of the CONCAT_WITH_SPACE function.ExampleThe above code can be simplified like this:CONCAT_WITH_SPACE( bp.name_first, bp.name_last, 1 )

Correctly Implement Conditions in MySQL Stored Procedure

AmitDiwan
Updated on 16-Dec-2019 07:42:00

236 Views

To set conditions in stored procedure, use the below syntax −    if yourCondition then    yourStatement1;      else    yourStatement2';       end if ;     end     //Let us implement the above syntax in order to correct missing semicolon in stored procedure −mysql> delimiter // mysql> create procedure Test_Demo(In inputValue int)    -> BEGIN    -> if inputValue=10 then    -> select 'You have won 100$';    -> else    -> select 'Sorry !!!';     -> end if ;     -> end     -> // Query OK, 0 rows affected (0.20 ... Read More

Advertisements