Found 2749 Articles for Csharp

Anonymous Methods in C#

karthikeya Boyini
Updated on 19-Jun-2020 08:03:04


Pass a code block as a delegate parameter in C#, using the Anonymous methods in C#. Anonymous methods are the methods without a name, just the body.This is how you can declare Anonymous methods −delegate void DemoMethod(int n); ... DemoMethod dm = delegate(int a) {    Console.WriteLine("Our Anonymous Method: {0}", a); };As shown above, the following is the body of the anonymous method −Console.WriteLine("Our Anonymous Method: {0}", a);ExampleYou can try to run the following code to implement Anonymous methods in C# −Live Demousing System; delegate void Demo(int n); namespace MyDelegate {    class TestDelegate {       static int ... Read More

array-of- arrays double [][] in C#?

Samual Sam
Updated on 19-Jun-2020 07:31:53


Arrays of arrays in C# are known as Jagged Arrays. To declare jagged arrays, use the double [ ][ ].Let us now declare them −int [][] marks;Now, let us initialize it, wherein marks are arrays of 5 integers −int[][] marks = new int[][]{new int[]{ 90, 95 }, new int[]{ 89, 94 }, new int[]{ 78, 87 }, new int[]{ 76, 68 }, new int[]{ 98, 91 } };ExampleLet us now see the complete example of jagged arrays in C# and learn how to implement it −Live Demousing System; namespace MyApplication {    class MyDemoClass {       static void ... Read More

Access Modifiers in C#

karthikeya Boyini
Updated on 19-Jun-2020 07:32:31


Access Modifiers specifies the scope of variable and functions in C#. The following are the access modifiers used provided by C#:PublicThe public modifier sets no restriction on the access of members.ProtectedAccess limited to the derived class or class definition.InternalThe Internal access modifier access within the program that has its declaration.Protected internalIt has both the access specifiers provided by protected and internal access modifiers.PrivateLimited only inside the class in which it is declared. The members specified as private cannot be accessed outside the class.ExampleLet us see an example of protected access modifier, accessing the protected members −Live Demousing System; namespace MySpecifiers ... Read More

Asynchronous programming in C# using Async and Await keyword

Samual Sam
Updated on 19-Jun-2020 07:33:17

2K+ Views

Asynchronous programming in C# is an efficient approach towards activities blocked or access is delayed. If an activity is blocked like this in a synchronous process, then the complete application waits and it takes more time. The application stops responding. Using the asynchronous approach, the applications continue with other tasks as well.The async and await keywords in C# are used in async programming. Using them, you can work with .NET Framework resources, .NET Core, etc.  Asynchronous methods defined using the async keyword are called async methods.An application with a GUI, check the content of the queue and if an unprocessed ... Read More

Abstract Classes in C#

karthikeya Boyini
Updated on 19-Jun-2020 07:34:12

1K+ Views

An abstract class in C# includes abstract and non-abstract methods. A class is declared abstract to be an abstract class. You cannot instantiate an abstract class.Let us see an example, wherein we have an abstract class Vehicle and abstract method display()−public abstract class Vehicle {    public abstract void display(); } The abstract class has derived classes: Bus, Car, and  Motorcycle. The following is an implementation of the Bus derived class −public class Bus : Vehicle {    public override void display() {       Console.WriteLine("Bus");    } } ExampleLet us see the complete example of abstract classes in C# −Live ... Read More

A Deque Class in C#

Samual Sam
Updated on 19-Jun-2020 07:35:29

1K+ Views

The Deque class uses a doubly-linked list to implement its collection of elements.  The doubly-linked lists should have two nodes i.e. front and back nodes. This helps in adding elements on the front and back of the Deque.With the Deque class, you have the ability to add and remove elements from both the sides. This is why Deque is said to be a double-ended queue.The Deque class has the following methods in the Queue class −ClearClears the collection of all of its elementsContainsWhether or not an object is in the collectionToArrayUse the ToArray() method to copy all of the elements ... Read More

‘this’ keyword in C#

karthikeya Boyini
Updated on 19-Jun-2020 07:38:18

8K+ Views

The “this” keyword in C# is used to refer to the current instance of the class. It is also used to differentiate between the method parameters and class fields if they both have the same name.Another usage of “this” keyword is to call another constructor from a constructor in the same class.Here, for an example, we are showing a record of Students i.e: id, Name, Age, and Subject. To refer to the fields of the current class, we have used the “this” keyword in C# −public Student(int id, String name, int age, String subject) { = id;   ... Read More

Upgraded to connector 3.0 is not working in Visual Studio 2008 and 2010

Samual Sam
Updated on 16-Mar-2020 07:03:14


Note that connector doesn’t work similar to 2.0 connector. There are lot many changes- good and bad provisioned in .net 3.0 version.This is SAP documentation link about general capabilities of connector: 10000000a421937/frameset.htmSAP .NET Connector 3.0 is the current version of SAP's development environment for communication between the Microsoft .NET platform and SAP systems. With the use of connector, you can connect SAP system to all common programming languages like: Visual Basic. NET, C#, or Managed C++ and many more. Following are the advantage of upgrading to 3.0:This version is no longer bound to a special Visual Studio ... Read More

Existing RFC to load table data, and to get list of tables and list of BAPI’s in SAP

Akshaya Akki
Updated on 16-Mar-2020 06:57:46


I am not sure that there exists a BAPI to see list of all BAPI’s in SAP system. You can use the Function module RFC_FUNCTION_SEARCH to search for function modules starting with BAPI*.ExampleYou can call Function Module-BAPI_MONITOR_GETLIST to get list of all available BAPI’s.CALL FUNCTION'BAPI_MONITOR_GETLIST' EXPORTING OBJECTTYPE = p_ojtpe SHOW_RELEASE = p_rel BAPIS_POTENTIAL = p_poten BAPIS_NEW = p_new_pabi BAPIS_OLD = p_old_bapi RELEASED_BAPI = p_rel_bapi RELEASED_FUNC = p_released_func IMPORTING RETURN = d_ret TABLES COMPONENTS2SELECT = int_cs SYSTEMS2SELECT = int_sss BAPILIST = int_bapilistThere exists a Function module - RFC_READ_TABLE, this can be used for external access to SAP R/3 system via RFC.Using ... Read More