Click here to Skip to main content
16,005,138 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Number of web.config file in a single web application Pin
Vasudevan Deepak Kumar10-Jul-07 23:09
Vasudevan Deepak Kumar10-Jul-07 23:09 
Questionhow to stop time interval in java script forever Pin
Piyush Vardhan Singh10-Jul-07 21:03
Piyush Vardhan Singh10-Jul-07 21:03 
Questionfollow up question... regarding asp deployment Pin
moomoooomoo10-Jul-07 20:41
moomoooomoo10-Jul-07 20:41 
Questioncalculate infinite precision Pin
yesu prakash10-Jul-07 20:39
yesu prakash10-Jul-07 20:39 
AnswerRe: calculate infinite precision Pin
valerian.precop10-Jul-07 20:55
valerian.precop10-Jul-07 20:55 
AnswerRe: calculate infinite precision Pin
Sathesh Sakthivel10-Jul-07 20:57
Sathesh Sakthivel10-Jul-07 20:57 
AnswerRe: calculate infinite precision Pin
Guffa10-Jul-07 21:06
Guffa10-Jul-07 21:06 
QuestionIndex was out of range [modified] Pin
ASPnoob10-Jul-07 20:31
ASPnoob10-Jul-07 20:31 
Hi, I'm trying to read a blob from my database table but ran into a little problem that I can't seem to solve. The following code is used in the page load and the button_click section of the code behind. I got the exception
"Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index"
when I tried to view it in the browser.
<br />
Dim i As Integer<br />
For i = 0 To ListBox2.Items.Count - 1<br />
If ListBox2.Items(i).Selected Then<br />
Dim myCon As New OdbcConnection<br />
<br />
myCon = New OdbcConnection("Driver={MySQL ODBC 3.51 Driver};Server=myServer;Database=myDB;User=myUserassword=myPass;Option=3;")<br />
Dim cmd As New OdbcCommand("SELECT * FROM myTable where Professions = '"& ListBox2.Items(i).Text &"' ")<br />
<br />
myCon.Open()<br />
<br />
cmd.Connection = myCon<br />
<br />
Dim ds As New DataSet<br />
<br />
Dim ad As New OdbcDataAdapter(cmd)<br />
<br />
ad.Fill(ds)<br />
<br />
Me.ListBox2.DataSource = ds<br />
<br />
Me.ListBox2.DataTextField = "Professions"<br />
<br />
Me.ListBox2.DataBind()<br />
End If<br />
Next<br />

I searched online for possible causes of this error but, none of the causes that I found has anything to do with my situation. Please take a look to see what I might of missed, thank you in advance for your help.



-- modified at 3:46 Wednesday 11th July, 2007
AnswerRe: Index was out of range Pin
Rhys Gravell10-Jul-07 20:46
professionalRhys Gravell10-Jul-07 20:46 
AnswerRe: Index was out of range Pin
valerian.precop10-Jul-07 20:48
valerian.precop10-Jul-07 20:48 
GeneralRe: Index was out of range Pin
ASPnoob10-Jul-07 20:55
ASPnoob10-Jul-07 20:55 
AnswerRe: Index was out of range Pin
Imran Khan Pathan10-Jul-07 20:56
Imran Khan Pathan10-Jul-07 20:56 
GeneralRe: Index was out of range Pin
ASPnoob10-Jul-07 21:15
ASPnoob10-Jul-07 21:15 
GeneralRe: Index was out of range Pin
Imran Khan Pathan10-Jul-07 21:33
Imran Khan Pathan10-Jul-07 21:33 
AnswerRe: Index was out of range Pin
valerian.precop10-Jul-07 21:11
valerian.precop10-Jul-07 21:11 
AnswerRe: Index was out of range Pin
Guffa10-Jul-07 21:12
Guffa10-Jul-07 21:12 
AnswerRe: Index was out of range Pin
ASPnoob10-Jul-07 21:44
ASPnoob10-Jul-07 21:44 
GeneralRe: Index was out of range Pin
Rhys Gravell10-Jul-07 21:50
professionalRhys Gravell10-Jul-07 21:50 
GeneralRe: Index was out of range Pin
Imran Khan Pathan10-Jul-07 22:03
Imran Khan Pathan10-Jul-07 22:03 
Questionjust asking for compatibility.... Pin
moomoooomoo10-Jul-07 20:29
moomoooomoo10-Jul-07 20:29 
Questionrefresh the page asp.net2.0+c# Pin
regin10-Jul-07 20:28
regin10-Jul-07 20:28 
AnswerRe: refresh the page asp.net2.0+c# Pin
N a v a n e e t h10-Jul-07 20:52
N a v a n e e t h10-Jul-07 20:52 
GeneralRe: refresh the page asp.net2.0+c# Pin
regin10-Jul-07 20:57
regin10-Jul-07 20:57 
GeneralRe: refresh the page asp.net2.0+c# Pin
Imran Khan Pathan10-Jul-07 21:05
Imran Khan Pathan10-Jul-07 21:05 
GeneralRe: refresh the page asp.net2.0+c# Pin
regin10-Jul-07 21:15
regin10-Jul-07 21:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.