Datareader-grid Irregular display

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Paulson
    New Member
    • Apr 2007
    • 63

    #1

    Datareader-grid Irregular display

    Hi everyone,
    I'm pretty new to this forum.Please help me tigers.Let me get to my problem

    I am developing and Desktop(Windows ) Application using VB.Net.
    I am using -------->"sqldatareader "<-------- to retrieve values from the database.
    The values retrieved from the db is passed as an arraylist.
    Everything works fine untill I bind the arraylist with the datagrid.
    All values are coming(displaye d) in grid but the order is ------->Irregular<--------

    Does any one know why this happens.Pls tell me if u know(Please also tell me the reason why it comes like that).

    But if I use DataSet there is no problem. PLs help guys and gals.

    Thanx in advance
  • kenobewan
    Recognized Expert Specialist
    • Dec 2006
    • 4871

    #2
    Please post the relevant code. Thanks.

    Comment

    • Paulson
      New Member
      • Apr 2007
      • 63

      #3
      Originally posted by kenobewan
      Please post the relevant code. Thanks.
      Thanks for replying Do u need just the code of accessing part or displaying part?

      Comment

      • Paulson
        New Member
        • Apr 2007
        • 63

        #4
        Originally posted by Paulson
        Thanks for replying Do u need just the code of accessing part or displaying part?
        Hi In my Desktop Application I call a function from UI

        The code is as follows

        _______________ _______________ _______________ _______________ ______

        Dim objDataHandler As New DataHandler
        Try
        dgResidentList. DataSource = objDataHandler. getResidents()
        dgResidentList. ReadOnly = True
        dgResidentList. Enabled = False
        Catch ex As Exception

        End Try
        _______________ _______________ _______________ _______________ ______

        The db related operation where datreader reads the values [Code] is as follows

        _______________ _______________ _______________ _______________ ______

        Public Function getResidents() As ArrayList

        Dim arrList As New ArrayList
        Dim dr As SqlDataReader
        Dim conn As String
        conn = getConn()
        dr = SqlHelper.Execu teReader(conn, CommandType.Sto redProcedure, "getResiden ts")


        While dr.Read
        Dim objUser As New Data.Resident
        objUser.Name = dr("Name")
        objUser.Address = dr("Addr")
        objUser.MobNo = dr("Mobile")
        ' objUser.Telepho ne = dr("Phone")
        objUser.Employe d = dr("Employed")
        objUser.RecordS tatusId = dr("RecordStatu sId")
        arrList.Add(obj User)
        End While

        Return arrList


        End Function
        _______________ _______________ _______________ _______________ ______

        The sql query(stored procedre written is )

        [ Select * from DamecResident] ------------>Damec Resident is a table


        PLease Help if u can
        bye Paulson.

        Comment

        Working...