TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Guest User
Tech Writer
2.1k
465.4k
Object reference is not non static member
Oct 10 2019 3:16 AM
Hi Team
I need some help here below with my code, the code is trying to use servicebus message in order to receive output from power bi desktop. But i am getting the following error on this object reference;
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Text;
using
System.Threading.Tasks;
using
System.Configuration;
using
Microsoft.Azure.ServiceBus;
using
Microsoft.ServiceBus.Messaging;
namespace
ACTS083ConsoleApplication
{
class
Program
{
string
ConnectionString = ConfigurationManager.AppSettings[
"Microsoft.ServiceBus.ConnectionString"
];
EventHubClient client = EventHubClient.CreateFromConnectionString(ConnectionString,
"pbidata"
);
static
void
Main(
string
[] args)
{
Int32 unixTimestamp = (Int32)(DateTime.UtcNow.Subtract(
new
DateTime(2019, 1, 1))).TotalSeconds;
Random r =
new
Random();
int
currentValue = r.Next(0, 100);
string
postData = String.Format(
"[{{\"ts\":{0},\"value\":{1}}]"
, unixTimestamp, currentValue);
client.Send(
new
EventData(Encoding.UTF8.GetBytes(postData)));
Console.WriteLine(
"Message sent. Press Enter to Continue"
);
Console.ReadLine();
}
}
}
Reply
Answers (
1
)
how to get a middle string value in split
i want convert this script in linq c#