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

ASP.NET

 
QuestionPerforming Double Click Event in a ListBox [modified] Pin
Mahesh.J12-Jul-07 19:17
Mahesh.J12-Jul-07 19:17 
AnswerRe: Performing Double Click Event in a ListBox Pin
RepliCrux12-Jul-07 19:29
RepliCrux12-Jul-07 19:29 
GeneralRe: Performing Double Click Event in a ListBox Pin
Mahesh.J12-Jul-07 19:35
Mahesh.J12-Jul-07 19:35 
QuestionUnknown entity class: NHibernate.Examples.QuickStart.User Pin
itbrainsoft12-Jul-07 19:15
itbrainsoft12-Jul-07 19:15 
AnswerRe: Unknown entity class: NHibernate.Examples.QuickStart.User Pin
RepliCrux12-Jul-07 19:36
RepliCrux12-Jul-07 19:36 
QuestionDebugging Pin
ASPnoob12-Jul-07 18:02
ASPnoob12-Jul-07 18:02 
AnswerRe: Debugging Pin
Christian Graus12-Jul-07 18:24
protectorChristian Graus12-Jul-07 18:24 
GeneralRe: Debugging [modified] Pin
ASPnoob12-Jul-07 19:25
ASPnoob12-Jul-07 19:25 
Thanks for replying, I've sort of gotten it to work. What I forgot to do was I forgot to use the if statement in the Page Load to determine if myCon is null when no list item is selected. I did use the if statement for that purpose in the Button1_Click part of my app. The problem now though is I see a box generated when I run my app but there is nothing in it. The box is supposed to display data retrieved from the database. The following is my code.
<br />
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click, Button1.Click<br />
        Dim myCon As OdbcConnection<br />
        Dim i As Integer<br />
        Dim cmd As OdbcCommand<br />
        For i = 0 To ListBox2.Items.Count - 1<br />
            If ListBox2.Items(i).Selected Then<br />
<br />
                myCon = New OdbcConnection("Driver={MySQL ODBC 3.51 Driver};Server=myServer;Database=myDatabase;User=myUser;Password=myPass;Option=3;")<br />
                cmd = New OdbcCommand("SELECT * FROM myTable where Professions = '" & ListBox2.Items(i).Text & "'")<br />
<br />
            End If<br />
        Next<br />
        If Not IsNothing(myCon) Then<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 />
    End Sub<br />



-- modified at 1:34 Friday 13th July, 2007
Questionadjusting the row height in datagrid asp.net 2003... Pin
moomoooomoo12-Jul-07 17:33
moomoooomoo12-Jul-07 17:33 
AnswerRe: adjusting the row height in datagrid asp.net 2003... Pin
Sathesh Sakthivel12-Jul-07 18:04
Sathesh Sakthivel12-Jul-07 18:04 
GeneralRe: adjusting the row height in datagrid asp.net 2003... Pin
| Muhammad Waqas Butt |13-Jul-07 21:42
professional| Muhammad Waqas Butt |13-Jul-07 21:42 
QuestionDatagrid Checkbox checked value is not getting Pin
Kurian_Kurian12-Jul-07 16:55
Kurian_Kurian12-Jul-07 16:55 
AnswerRe: Datagrid Checkbox checked value is not getting Pin
Imran Khan Pathan12-Jul-07 18:57
Imran Khan Pathan12-Jul-07 18:57 
GeneralRe: Datagrid Checkbox checked value is not getting Pin
Kurian_Kurian12-Jul-07 19:30
Kurian_Kurian12-Jul-07 19:30 
QuestionAbout Crystal Report Pin
wongeva12-Jul-07 15:52
wongeva12-Jul-07 15:52 
AnswerRe: About Crystal Report Pin
Paul Conrad12-Jul-07 17:45
professionalPaul Conrad12-Jul-07 17:45 
QuestionHow to disable a button and still have the click event to fire. Pin
Martin_12-Jul-07 11:09
Martin_12-Jul-07 11:09 
AnswerRe: How to disable a button and still have the click event to fire. Pin
DanB198312-Jul-07 11:47
DanB198312-Jul-07 11:47 
AnswerRe: How to disable a button and still have the click event to fire. Pin
Venkatesh Mookkan12-Jul-07 16:34
Venkatesh Mookkan12-Jul-07 16:34 
AnswerRe: How to disable a button and still have the click event to fire. Pin
K.P.Kannan12-Jul-07 17:16
K.P.Kannan12-Jul-07 17:16 
QuestionMenus and Membership/Role Pin
Amit Kumar G12-Jul-07 10:27
Amit Kumar G12-Jul-07 10:27 
QuestionNeed a VERY fast tree Pin
DarrollWalsh12-Jul-07 9:52
DarrollWalsh12-Jul-07 9:52 
AnswerRe: Need a VERY fast tree Pin
Christian Graus12-Jul-07 10:00
protectorChristian Graus12-Jul-07 10:00 
AnswerRe: Need a VERY fast tree Pin
Pete O'Hanlon12-Jul-07 10:18
mvePete O'Hanlon12-Jul-07 10:18 
Questionpage timesout Pin
VickyC#12-Jul-07 8:18
VickyC#12-Jul-07 8:18 

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.