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
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
bye Paulson
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
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
bye Paulson
Comment