-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: Kannan
Message 3 in Discussion
Hi Ramezh1,
I think what ever you tried should have worked. Please try using the below code. This
code adds the values from the Data Reader object into the Array List and prints the
same values by retrieving from the ArrayList.
Dim sqlCon As New
SqlConnection("server=MyServer;database=MyDataBase;uid=sa;pwd=password;")
Dim sqlCmd As New SqlCommand("Select TOP 10 lastName from CMN_Persons", sqlCon)
Dim sqlDataRdr As SqlDataReader
Dim i As Integer
Dim DocId As New ArrayList(10)
sqlCon.Open()
sqlDataRdr = sqlCmd.ExecuteReader(CommandBehavior.CloseConnection)
While sqlDataRdr.Read
DocId.Add(sqlDataRdr.GetValue(0))
End While
For i = 0 To 9
Response.Write(CStr(DocId.Item(i)) & "<BR/>")
Next i
sqlDataRdr.Close()
sqlCon.Close()
sqlCmd.Dispose()
Regards,
R.Kannan.
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you received
this message by mistake, please click the "Remove" link below. On the pre-addressed
e-mail message that opens, simply click "Send". Your e-mail address will be deleted
from this group's mailing list.
mailto:[EMAIL PROTECTED]