You’ll need to create an instance of the class and invoke the method on it.
public class Foo
{
public void Data1()
{
}
public static void Data2()
{
Foo foo = new Foo();
foo.Data1();
}
}
More Related Contents:
- Speed up reading a file to multiple bytes array and copy the offsets by if statement
- VS2010 does not show unhandled exception message in a WinForms Application on a 64-bit version of Windows
- Difference Between Select and SelectMany
- Comparing double values in C#
- Large Object Heap Fragmentation
- How do I access ARP-protocol information through .NET?
- Copy constructor versus Clone()
- How can I return a custom HTTP status code from a WCF REST method?
- Generic Way to Check If Entity Exists In Entity Framework?
- How can I export a GridView.DataSource to a datatable or dataset?
- Easiest way to parse “querystring” formatted data
- Create an application that will expire after a trial period [duplicate]
- Suppress Null Value Types from Being Emitted by XmlSerializer
- MVC 5 BeginCollectionItem with Partial CRUD
- Add offset to IntPtr
- c# Active Directory Services findAll() returns only 1000 entries [duplicate]
- Why use async and return await, when you can return Task directly?
- Parsing a JSON file with .NET core 3.0/System.text.Json
- Set CultureInfo in Asp.net Core to have a . as CurrencyDecimalSeparator instead of ,
- Return Json, but it includes backward slashes “\”, which I don’t want
- How do I get the name of captured groups in a C# Regex?
- How to sort a dictionary by key
- C# JSON custom serialization
- Resize borderless window on bottom right corner
- WPF Filter a ListBox
- Change cell color on different values – Gridview
- PropertyChanged for indexer property
- Xamarin : Android : System.UnauthorizedAccessException: Access to the path is denied
- .net connection pooling
- External signing PDF with iText