Results 1 to 7 of 7

Thread: Translation please

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2002
    Location
    Helsingborg,Sweden
    Posts
    35

    Smile Translation please

    Hi!

    I need some help...

    I have just begun to use .NET and now i need som translations between ASP and ASP.NET VB

    In the old fashion way you could use


    Code:
    Set rst=Con.Execute(SQL)
    
    Do until rst.EOF
    
    
    rst .MoveNext
    loop.
    What is the oposit code for the do part in ASP.NET

    and this code i ASP
    Code:
    If rst.EOF then
        ' some code
    else
       ' some code
    end if

    and finally

    [CODE]
    IF rst("IDnumer") = 15 then
    ' some code
    end if


    I will be greatful for any help, but i am new at .NET som i need simple explenations

    /tyson

  2. #2
    Addicted Member MasterBlaster's Avatar
    Join Date
    Jul 2002
    Location
    Seattle
    Posts
    196

    Re: Translation please

    Originally posted by tyson

    Code:
    Set rst=Con.Execute(SQL)
    
    Do until rst.EOF
    
    
    rst .MoveNext
    loop.
    Code:
    foreach(DataRow myrow in mytable)
    {
           // todo
    }
    What is the oposit code for the do part in ASP.NET

    and this code i ASP
    Code:
    If rst.EOF then
        ' some code
    else
       ' some code
    end if
    No such thing , don't need to worry about eof any more



    and finally

    Code:
    IF rst("IDnumer") = 15 then
        ' some code
    end if
    Code:
    if(myrow["IDNumber"] == 15)
    {
           //todo
    }
    I will be greatful for any help, but i am new at .NET som i need simple explenations

    /tyson
    "And most of the evils of society can, in fact, be cured through information. We have a society that has been disinformed and based on the disinformation has made irrational choices. And that's what I mean by 'ignorance.' People, who ordinarily might be smart, are deprived of the data by which to make a rational decision, don't have the data to do it."
    Frank Zappa

  3. #3

    Thread Starter
    Member
    Join Date
    Aug 2002
    Location
    Helsingborg,Sweden
    Posts
    35
    ok... but if i want to use a similar function as

    If rst.EoF then

    else

    end if

    /Tyson

  4. #4
    Addicted Member MasterBlaster's Avatar
    Join Date
    Jul 2002
    Location
    Seattle
    Posts
    196
    There is no such thing as EOF.
    "And most of the evils of society can, in fact, be cured through information. We have a society that has been disinformed and based on the disinformation has made irrational choices. And that's what I mean by 'ignorance.' People, who ordinarily might be smart, are deprived of the data by which to make a rational decision, don't have the data to do it."
    Frank Zappa

  5. #5
    Addicted Member MasterBlaster's Avatar
    Join Date
    Jul 2002
    Location
    Seattle
    Posts
    196
    http://www.codeproject.com/dotnet/adonet_datareader.asp

    Look over this sample. It is pretty simple.
    "And most of the evils of society can, in fact, be cured through information. We have a society that has been disinformed and based on the disinformation has made irrational choices. And that's what I mean by 'ignorance.' People, who ordinarily might be smart, are deprived of the data by which to make a rational decision, don't have the data to do it."
    Frank Zappa

  6. #6
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    Here I'm using a datareader object to illustrate one way of doing this...
    VB Code:
    1. drSQL = .ExecuteReader(CommandBehavior.CloseConnection)
    2.  
    3. Do While drSQL.read = true
    4.      ' Code Here
    5. Loop

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  7. #7

    Thread Starter
    Member
    Join Date
    Aug 2002
    Location
    Helsingborg,Sweden
    Posts
    35
    Ok... I shall try it and then i will get back..

    thanks for now


    /Tyson

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width