I am new to coding and VB. I imported a C# page into a converter and came out with this.
Two errors, one of which refers to this line: Public Shared ReadOnly Property DbProviderName() As String states that DBPRovider name is already declared as a string- which it is, of course. (Private Shared dbProviderName As String)
My question is does that mean I can get rid of that Property value?
I would note that the C# code does not come with this error; you can declare a static item first and then declare it again as a property.
Two errors, one of which refers to this line: Public Shared ReadOnly Property DbProviderName() As String states that DBPRovider name is already declared as a string- which it is, of course. (Private Shared dbProviderName As String)
My question is does that mean I can get rid of that Property value?
I would note that the C# code does not come with this error; you can declare a static item first and then declare it again as a property.
VB.NET:
Imports Microsoft.VisualBasic
Imports System.Configuration
Public Class ECommerceConfig
''' <summary>
''' Repository for ECommerce configuration settings
''' </summary>
Public Class ECommerceConfig
' Caches the connection string
Private Shared dbConnectionString As String
' Caches the data provider name
Private Shared dbProviderName As String
Shared Sub New()
dbConnectionString = ConfigurationManager.ConnectionStrings("ECommerceConnection").ConnectionString
dbProviderName = ConfigurationManager.ConnectionStrings("ECommerceConnection").ProviderName
End Sub
' Returns the connection string for the BalloonShop database
[B]Public Shared ReadOnly Property DbConnectionString() As String[/B]
Get
Return dbConnectionString
End Get
End Property
' Returns the data provider name
[B]Public Shared ReadOnly Property DbProviderName() As String[/B] Get
Return dbProviderName
End Get
End Property