please explain this insert works, but i have never seen it before

Posted on 2004-11-16
Last Modified: 2010-04-23

Dim Qry as String
Dim NumberOfRows As Integer=100 '----------> FOR 100 ROWS
Dim NumberOfColumns As Integer=8 '---------> FOR A through H Seats
Dim PlaneID as String="3434278231"
Dim SeatType as String

For i=1 to NumberOfRows
    For j=1 to NumberOfColumns
        If j=1 Or J=8 Then
            'Assuming A & H are Window Seats
           'More If Blocks might come here as per Seating arrangement
        End If
        Qry=String.Format("INSERT INTO TBL_SEAT (SEAT_NUM, SEAT_ROW, SEAT_TYPE, PLANE_ID) VALUES ('{0}', {1},'{2}', '{3}');",Chr(64+j),i,SeatType,PlaneID)

    Next j
Next i

what does this part do:
 ('{0}', {1},'{2}', '{3}');",Chr(64+j)
Question by:NickUA
    1 Comment
    LVL 24

    Accepted Solution

    ('{0}', {1},'{2}', '{3}');",Chr(64+j),i,SeatType,PlaneID) inserts Chr(64+j) into {0}, i into {1}, etc... allows you to easily put the values of the calculations/methods into the spots where {x} appear.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    This video discusses moving either the default database or any database to a new volume.

    794 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now