vick82 Posted December 2, 2003 Posted December 2, 2003 (edited) I m getting error of Index was outside the bounds of the array. loook at the code in bold [b]Dim arrBid = Split(objBid.getMaxBidInfo(auctionId), ";") bidderId = arrBid(0) bidPrice = CInt(arrBid(1))[/b] Public Function getBasicInfo(ByVal uid As Integer) As String Dim myDataReader As SqlDataReader Dim s_b_Info As String Dim myConnection As SqlConnection = New SqlConnection(ConfigurationSettings.AppSettings("ConnectionString")) Dim myCommand As SqlCommand = New SqlCommand("Select uName,email from t_user where uId=" & uid & "", myConnection) myConnection.Open() Try myDataReader = myCommand.ExecuteReader() If myDataReader.Read() Then [b]s_b_Info = myDataReader.Item("uName") & "," & myDataReader.Item("email")[/b] End If Catch b As Exception Return b.ToString End Try Edited December 2, 2003 by Robby Quote
Moderators Robby Posted December 2, 2003 Moderators Posted December 2, 2003 the dr.Read should be While not If. and where is getMaxBidInfo(), is it returning the expected data? Quote Visit...Bassic Software
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.