Click here to Skip to main content
15,910,130 members
Home / Discussions / Database
   

Database

 
GeneralRe: Replication: Storing snapshot at FTP site. Pin
tojamismis4-Feb-05 6:50
tojamismis4-Feb-05 6:50 
GeneralSQL 2000: Index manager hangs while adding Index Pin
Chris Maunder3-Feb-05 11:15
cofounderChris Maunder3-Feb-05 11:15 
GeneralRe: SQL 2000: Index manager hangs while adding Index Pin
Mike Dimmick3-Feb-05 23:54
Mike Dimmick3-Feb-05 23:54 
GeneralRe: SQL 2000: Index manager hangs while adding Index Pin
Chris Maunder4-Feb-05 0:23
cofounderChris Maunder4-Feb-05 0:23 
GeneralRe: SQL 2000: Index manager hangs while adding Index Pin
Mike Dimmick4-Feb-05 5:53
Mike Dimmick4-Feb-05 5:53 
GeneralRe: SQL 2000: Index manager hangs while adding Index Pin
Chris Maunder4-Feb-05 17:02
cofounderChris Maunder4-Feb-05 17:02 
GeneralCreating a subset Pin
numbrel3-Feb-05 9:12
numbrel3-Feb-05 9:12 
GeneralRe: Creating a subset Pin
Just Greeky Creek3-Feb-05 21:45
Just Greeky Creek3-Feb-05 21:45 
Do u mean that u got 2 combobox, 1st lists organisations, 2nd lists events sponsored by selected organisation in 1st ComboBox?

If so; I think u have two tables, one has organisations list, others has events then assume two table is related to each other with OrganisationID.

1. Warn = use Just ONE DATASET, if not, it s painful.

============================================================================
Imports System.Data.SqlClient<br />
Public Class frmOrganisationsAndEvents<br />
    Inherits System.Windows.Forms.Form<br />
<br />
    ' On Form There is two ComboBox named cmbOrganisations and cmbEvents<br />
<br />
    Dim cnOE As New SqlConnection("")<br />
    Dim dsOE As New DataSet<br />
    Dim dRowOE() As DataRow<br />
    Private Sub frmOrganisationsAndEvents_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
        Dim adpOE As New SqlDataAdapter("SELECT * FROM Organisations", cnOE)<br />
        adpOE.Fill(dsOE, "Organisations")<br />
        adpOE.SelectCommand.CommandText = "SELECT * FROM Events"<br />
        adpOE.Fill(dsOE, "Events")<br />
        For i As Short = 0 To dsOE.Tables("Organisations").Rows.Count - 1<br />
            cmbOrganisations.Items.Add(dsOE.Tables("Organisations").Rows(i)("O_OrganisationName"))<br />
        Next<br />
        If Not cmbOrganisations.Items.Count = 0 Then<br />
            cmbOrganisations.Text = "Select an Organisation"<br />
        Else<br />
            cmbOrganisations.Text = "No Organisation Installed"<br />
        End If<br />
    End Sub<br />
<br />
    Private Sub cmbOrganisations_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmbOrganisations.SelectedIndexChanged<br />
        If Not cmbOrganisations.Items.Count = 0 And cmbOrganisations.SelectedIndex = -1 Then<br />
            cmbEvents.Items.Clear()<br />
         'Events SubSet <br />
            drowOE = dsOE.Tables("Events").Select("E_OrganisationID=" & dsOE.Tables("Organisations").Rows(cmbOrganisations.SelectedIndex)("O_OrganisationID"))<br />
            If Not dRowOE.Length = 0 Then<br />
                For i As Short = 0 To dRowOE.GetUpperBound(0)<br />
                    cmbEvents.Items.Add(dRowOE(i)("E_EventAlias"))<br />
                Next<br />
                cmbOrganisations.Text = "Select Event Sponsored by " & dsOE.Tables("Organisations").Rows(cmbOrganisations.SelectedIndex)("O_OrganisationName")<br />
            Else<br />
                cmbOrganisations.Text = "No Event Installed Sponsored by " & dsOE.Tables("Organisations").Rows(cmbOrganisations.SelectedIndex)("O_OrganisationName")<br />
            End If<br />
        End If<br />
    End Sub<br />
<br />
    Private Sub cmbEvents_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmbEvents.SelectedIndexChanged<br />
        If Not cmbEvents.SelectedIndex = -1 Then<br />
            GetEventDetails(EventID:=dRowOE(cmbEvents.SelectedIndex)("E_EventID"))<br />
        End If<br />
    End Sub<br />
    Protected Sub GetEventDetails(ByVal EventID As Integer)<br />
        'Read Details From Database<br />
    End Sub<br />
<br />
    Private Sub cmbOrganisationsAndcmbEvents_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles cmbOrganisations.KeyPress, cmbEvents.KeyPress<br />
        e.Handled = True<br />
    End Sub<br />
End Class

GeneralINNER join question Pin
Imtiaz Murtaza3-Feb-05 1:36
Imtiaz Murtaza3-Feb-05 1:36 
GeneralRe: INNER join question Pin
Colin Angus Mackay3-Feb-05 2:04
Colin Angus Mackay3-Feb-05 2:04 
GeneralRe: INNER join question Pin
Mike Dimmick4-Feb-05 0:12
Mike Dimmick4-Feb-05 0:12 
GeneralRe: INNER join question Pin
Colin Angus Mackay4-Feb-05 0:28
Colin Angus Mackay4-Feb-05 0:28 
GeneralRe: INNER join question Pin
Just Greeky Creek3-Feb-05 2:25
Just Greeky Creek3-Feb-05 2:25 
GeneralFirehose Mode Pin
Shady Aly3-Feb-05 1:05
Shady Aly3-Feb-05 1:05 
GeneralRe: Firehose Mode Pin
Colin Angus Mackay3-Feb-05 2:08
Colin Angus Mackay3-Feb-05 2:08 
GeneralautoNumber and Max+1 which is Best Pin
TariqMahmood2-Feb-05 18:52
TariqMahmood2-Feb-05 18:52 
GeneralRe: autoNumber and Max+1 which is Best Pin
Just Greeky Creek2-Feb-05 20:56
Just Greeky Creek2-Feb-05 20:56 
GeneralRe: autoNumber and Max+1 which is Best Pin
David Salter3-Feb-05 22:39
David Salter3-Feb-05 22:39 
GeneralConfused about Subqueries grammer. Pin
denniskang20042-Feb-05 16:34
denniskang20042-Feb-05 16:34 
GeneralRe: Confused about Subqueries grammer. Pin
Just Greeky Creek2-Feb-05 21:16
Just Greeky Creek2-Feb-05 21:16 
Generalpassing DataReader obj Pin
DFrag2-Feb-05 11:32
DFrag2-Feb-05 11:32 
GeneralRe: passing DataReader obj Pin
Yulianto.2-Feb-05 17:19
Yulianto.2-Feb-05 17:19 
GeneralRe: passing DataReader obj Pin
DFrag3-Feb-05 3:39
DFrag3-Feb-05 3:39 
Generalxml importing and exporting Pin
lornej2-Feb-05 10:30
lornej2-Feb-05 10:30 
GeneralGeneral network error Pin
Marix2-Feb-05 4:01
Marix2-Feb-05 4:01 

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.