Conversion of C# code to VB code

Hi everyone,

I'm getting into Google's BigQuery, and am trying to piece together some sample code to do some basic functions.  All sample code I have come across on the .NET side has been C#.  I was hoping to write my applications in VB and most of the code is easily converted, except of two lines:

        ServiceAccountCredential credential = new ServiceAccountCredential(
            new ServiceAccountCredential.Initializer(serviceAccountEmail)
                Scopes = new[] { BigqueryService.Scope.Bigquery }

Open in new window


        var service = new BigqueryService(new BaseClientService.Initializer()
            HttpClientInitializer = credential,
            ApplicationName = ApplicationName

Open in new window

I have tried multiple online code converters to no avail.  Any assistance would be greatly appreciated.  

I'm using 4.5 framework for my app if that is important.

Thanks in advance,
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ste5anSenior DeveloperCommented:
See How to: Declare an Object by Using an Object Initializer (Visual Basic).

Dim service As BigqueryService = New BigqueryService(
	New BaseClientService.Initializer() With { 
		.HttpClientInitializer = credential, 
		.ApplicationName = ApplicationName 

Open in new window

But you don't need to make it in one declaration.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Mike EghtebasDatabase and Application DeveloperCommented:
Also check this site for converting to c# and c# to
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.