Click here to Skip to main content
15,891,607 members
Home / Discussions / ASP.NET
   

ASP.NET

 
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 
Try this code

But dont call this function on Page Load Event if ur ListBox2'items are empty.

Dim i As Integer<br />
<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 />
<br />
For i = 0 To ListBox2.Items.Count - 1<br />
If ListBox2.Items(i).Selected Then<br />
<br />
Dim cmd As New OdbcCommand("SELECT * FROM myTable where Professions = '"& ListBox2.Items(i).Text &"' ")<br />
<br />
End If<br />
<br />
Next<br />
<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 />
<br />
<br />
Best Regard<br />

Pathan

GOD HELP THOSE WHO HELP THEMSELVES

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 
GeneralRe: refresh the page asp.net2.0+c# Pin
Imran Khan Pathan10-Jul-07 21:25
Imran Khan Pathan10-Jul-07 21:25 
Questionconversion in vb6 to vb.net [modified] Pin
king2010-Jul-07 20:14
king2010-Jul-07 20:14 
AnswerRe: conversion in vb6 to vb.net Pin
Paul Conrad13-Jul-07 12:20
professionalPaul Conrad13-Jul-07 12:20 
Questionabout event fire Pin
SwaSubhaVijju10-Jul-07 19:19
SwaSubhaVijju10-Jul-07 19:19 
AnswerRe: about event fire Pin
sidbaruah10-Jul-07 19:22
sidbaruah10-Jul-07 19:22 
AnswerRe: about event fire Pin
_AK_10-Jul-07 19:28
_AK_10-Jul-07 19:28 
GeneralRe: about event fire Pin
N a v a n e e t h10-Jul-07 20:17
N a v a n e e t h10-Jul-07 20:17 
AnswerRe: about event fire Pin
N a v a n e e t h10-Jul-07 20:16
N a v a n e e t h10-Jul-07 20:16 
Questiondatagrid Pin
SwaSubhaVijju10-Jul-07 19:00
SwaSubhaVijju10-Jul-07 19:00 
AnswerRe: datagrid Pin
_AK_10-Jul-07 19:24
_AK_10-Jul-07 19:24 
Questiongridview paging Pin
yesu prakash10-Jul-07 18:41
yesu prakash10-Jul-07 18:41 

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.