Equivalent of ADODC.recordset.field("<name>") in Visual studio 2005

Hi all
I am a newbie.. so please be patient with me

i have been using vb6 all along
very recenty i am working myself on Visual Studio 2005

once i establised the conection to my MSAccess database (Trial.mdb) and refrence to the table (birthday_table)

i am able to conect my textboxes to thetable and retrive recods in the table
I ma using bindingnavigatpr to move throght the records and the text boxes are getting refreshed accordngly


in VB6 i usually use msgbox Adodc1.recordset.feilds("Name") to retrive the value of current row

how do i acheve this in VISUAL STUDIO 2005



Answer this question

Equivalent of ADODC.recordset.field("<name>") in Visual studio 2005

  • Kjeld Tommeraas

    hi Ren

    I have dloaded and installed VISUAL STUDIO EXPRESS 2005 with MSDN.. (i have not installed VC#,VC++,VJ++,sql)
    ...so can i say i am using VB.net

    when i establis conection i have thE following controls on my form
    BINDINGSOURCE1
    TRIALDATASET
    BIRTHDAYTABLEADAPTER
    BIRTHDABINDINGSOURCE

    I WANT TO display the "name" as messagebox each time a button is clciked
    in VB6 i would be using. msgbox ADOC1.recordset.field("name")

    what would i be using now..to retrive records at runtime ...



  • APMadsen

     

    It's the same... only different.

    After I've become used to it.. I really like ADO.NET

    Lets say that you have a tables containing the following information represented in an Enumeration.

    Enum FieldName

              Name
              Age
              Sex
              Species ' I'm a dog mom

    End Enum

    You data is a in a datatable (PoochTable) and you want to kind the age of a dalmatian name Kyra

     

    For each row as datarow in PoochTable.Rows

      If ((row(FieldName.Name) = "Kyra")  And (row(FieldName.Species) = "Dalmatian") Then

    return row(fieldname.Age)

    end if

    Next

    That's all there is to it. You're dealing with rows and columns and in this respect ADO.Net is really nice. You can also use field names instead of enums.

     

     

     

     

     

     

     

     



  • Equivalent of ADODC.recordset.field("<name>") in Visual studio 2005