Record In VB.NET

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Golrokh Malek
    New Member
    • Sep 2006
    • 1

    Record In VB.NET

    Dear Sir/Madame;
    I have a VB.NET application accessing a SQL Server 2005 Database.
    And I want to know how can I use a Record in VB.NET.
    You would do me a favour if You send me a full description & some examples.


    I'm looking forward to see your reply

    Regards;
    G. Malek
  • angi the dark angel
    New Member
    • Sep 2006
    • 11

    #2
    what do u mean by record?
    reading a record from the SQL DB?
    Private Sub check_user_name ()
    Try
    Dim val As String = Nothing
    Dim com As SqlCommand
    Dim rd As SqlDataReader

    con.Close()
    con.Open()
    com = New SqlCommand("spn _tbln_Login_mas ter_uname_check ", con)
    com.CommandType = CommandType.Sto redProcedure
    com.Parameters. Add("@u_name", Trim(txtUser_Na me.Text))
    rd = com.ExecuteRead er
    If rd.HasRows = True Then
    While rd.Read
    val = Trim(rd(0))
    End While
    End If
    If val = Nothing Then
    u_name_correct = True
    Else
    u_name_correct = False
    End If
    rd.Close()
    Catch ex As Exception
    MsgBox(ex.Messa ge.ToString())
    End Try
    End Sub

    Comment

    • bstanden
      New Member
      • Nov 2008
      • 1

      #3
      Originally posted by angi the dark angel
      what do u mean by record?
      reading a record from the SQL DB?
      Private Sub check_user_name ()
      Try
      Dim val As String = Nothing
      Dim com As SqlCommand
      Dim rd As SqlDataReader

      con.Close()
      con.Open()
      com = New SqlCommand("spn _tbln_Login_mas ter_uname_check ", con)
      com.CommandType = CommandType.Sto redProcedure
      com.Parameters. Add("@u_name", Trim(txtUser_Na me.Text))
      rd = com.ExecuteRead er
      If rd.HasRows = True Then
      While rd.Read
      val = Trim(rd(0))
      End While
      End If
      If val = Nothing Then
      u_name_correct = True
      Else
      u_name_correct = False
      End If
      rd.Close()
      Catch ex As Exception
      MsgBox(ex.Messa ge.ToString())
      End Try
      End Sub

      I would like to create a deck of cards in an array with certain properties
      like faceValue and cardSuit and inDeck(boolean)
      it will be used for blackjack
      is there a way to just create a record so that i can call it up like this

      Dim cardArray(13,4) as string

      for faceValue as int = 1 to 13
      for suit as int = 1 to 4
      ' how can i declare array so that i can store .Suit ???
      cardArray(faceV alue,suit).Suit = suit
      'how can i declare array so that i can store .Number ???
      cardArray(faceV alue,suit).Numb er = faceValue
      next
      next

      Comment

      • Curtis Rutland
        Recognized Expert Specialist
        • Apr 2008
        • 3264

        #4
        OK.
        First, you've dug up a thread from 2006. Second, you've asked a question in it that has absolutely nothing to do with this thread. That's called thread hijacking and is not allowed on this forum.

        If you need help, please create your own thread. Remember to use [CODE] tags when posting your code.

        MODERATOR

        Comment

        Working...