The data values can be retrieved with the Eval method – they cannot be modified or deleted.
The Bind method on the other hand allows for the data-bound controls to be modified in addition to retrieval, and hence is preferred over Eval method.
Welcome to our developer-centric oasis! Dive into our blog where we unravel complexities, offer insightful tutorials, and share expert tips to help you navigate the ever-evolving world of coding. Whether you're a seasoned developer seeking advanced techniques or a beginner taking your first steps into the vast realm of programming, our articles are tailored to empower and inspire you on your journey.
Visual Basic Modifier
|
C# Modifier
|
Definition
|
Public (Visual Basic)
|
public
|
The type or member can be accessed by any other code in the same
assembly or another assembly that references it.
|
Private (Visual Basic)
|
private
|
The type or member can only be accessed by code in the same
class.
|
Protected (Visual Basic)
|
protected
|
The type or member can only be accessed by code in the same
class or in a derived class.
|
Friend (Visual Basic)
|
internal
|
The type or member can be accessed by any code in the same
assembly, but not from another assembly.
|
Protected Friend
|
protected internal
|
The type or member can be accessed by any code in the same
assembly, or by any derived class in another assembly.
|
//Declare namespace
Imports System
Imports System.Collections.Generic
Imports System.Text.RegularExpressions
Imports System.IO
Public Class ReadTNS
//Function for Load TNS Name
Public Function LoadTNSNames() As List(Of String)
Dim DBNamesCollection As New List(Of String)()
Dim regPattern As String = "[\n][\s]*[^\(][a-zA-Z0-9_.]+[\s]*"
Dim tnsNamesOraFilePath As String = GetPathToTNSNamesFile()
If Not tnsNamesOraFilePath.Equals("") Then
' Verify file exists
Dim tnsNamesOraFile As New FileInfo(tnsNamesOraFilePath)
If tnsNamesOraFile.Exists Then
If tnsNamesOraFile.Length > 0 Then
'read tnsnames.ora file
Dim tnsNamesContents As String = File.ReadAllText(tnsNamesOraFile.FullName)
Dim numMatches As Integer = Regex.Matches(tnsNamesContents, regPattern).Count
Dim col As MatchCollection = Regex.Matches(tnsNamesContents, regPattern)
For Each match As Match In col
Dim m As String = match.ToString()
m = m.Trim()
DBNamesCollection.Add(m.ToUpper())
Next
End If
End If
End If
Return DBNamesCollection
End Function
//Function for Get path of TNS File
Private Shared Function GetPathToTNSNamesFile() As String
Dim systemPath As String = Environment.GetEnvironmentVariable("Path")
Dim reg As New Regex("[a-zA-Z]:\\[a-zA-Z0-9\\]*(oracle|app)[a-zA-Z0-9_.\\]*(?=bin)")
Dim col As MatchCollection = reg.Matches(systemPath)
Dim subpath As String = "network\ADMIN\tnsnames.ora"
For Each match As Match In col
Dim path As String = match.ToString() & subpath
If File.Exists(path) Then
Return path
End If
Next
Return String.Empty
End Function
End Class