10

I'm a newbie in programming and visual basic 2008 language.

I'm learning to use sqlite database in visual basic 2008, and I got the following tutorial code. The code is working correctly and my question is: what is the meaning of that ! mark in the code. Please point to me where to get more information as I wish to learn more about that. I have Windows Sdk v6.1 installed.

Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
    Dim DatabaseFilepath As String = "e:\sqlite.db3"

    Dim SQLconnect As New System.Data.SQLite.SQLiteConnection()
    Dim SQLcommand As System.Data.SQLite.SQLiteCommand

    SQLconnect.ConnectionString = "Data Source=" & DatabaseFilepath & ";"
    SQLconnect.Open()

    SQLcommand = SQLconnect.CreateCommand

    Dim SchemaTable = SQLconnect.GetSchema(System.Data.SQLite.SQLiteMetaDataCollectionNames.Tables)

    For int As Integer = 0 To SchemaTable.Rows.Count - 1
        If SchemaTable.Rows(int)!TABLE_TYPE.ToString = "table" Then
            MessageBox.Show(SchemaTable.Rows(int)!TABLE_NAME.ToString())
        End If
    Next

    SQLcommand.Dispose()
    SQLconnect.Close()
End Sub

UPDATE:

Can anyone tell me what is the alternative for that bang operator in the code ? That bang operator looks unusual.

Sean
  • 381
  • 1
  • 5
  • 19
  • See also [Bang Notation and Dot Notation in VBA and MS-Access](https://stackoverflow.com/q/2923957/1364007) – Wai Ha Lee Jan 04 '19 at 16:13

1 Answers1

10

Its called the Bang Operator.

It means, use the default property of this type.

It was very common in VB6 code, used to access the fields of a Recordset and avoid trouble with field names that were also a keyword. An alternative to the dot operator and [brackets]. The bang still works:

value = row!column1

instead of

value = row("column1")

Consider it a typing aid, use at your discretion.

Jodrell
  • 34,946
  • 5
  • 87
  • 124