Click here to Skip to main content
15,887,822 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: How to Write in Excel File ? PinPopular
Andy_L_J11-May-08 22:13
Andy_L_J11-May-08 22:13 
GeneralRe: How to Write in Excel File ? Pin
Christian Graus12-May-08 0:05
protectorChristian Graus12-May-08 0:05 
QuestionInstallation Problem in VB Pin
aaraaayen11-May-08 21:07
aaraaayen11-May-08 21:07 
AnswerRe: Installation Problem in VB Pin
Christian Graus11-May-08 21:26
protectorChristian Graus11-May-08 21:26 
AnswerRe: Installation Problem in VB Pin
Dave Kreskowiak12-May-08 5:14
mveDave Kreskowiak12-May-08 5:14 
QuestionCorrect way to filter a databound combobox based on selection in other databound combobox? Pin
Gr1mR33p3r11-May-08 20:17
Gr1mR33p3r11-May-08 20:17 
AnswerRe: Correct way to filter a databound combobox based on selection in other databound combobox? Pin
Christian Graus11-May-08 20:59
protectorChristian Graus11-May-08 20:59 
AnswerRe: Correct way to filter a databound combobox based on selection in other databound combobox? Pin
Rupesh Kumar Swami11-May-08 22:34
Rupesh Kumar Swami11-May-08 22:34 
hi,
however Christian Graus already answer this question in therotically. if you have any problem in apply this thing practicaly then consider following
first of all use following statement in declaration section
Private ComboBox1LoadTime As Boolean<br />
 Dim ds, ds1 As New DataSet

<br />
now fill the combo box as following at load event of form <br />
<br />
Dim str As String<br />
<br />
        Dim mdins As New mdGlobal 'here mdglobal is <br />
        str = "select areaname,areaid from areainfo"<br />
        ds = New DataSet<br />
        ComboBox1LoadTime = True<br />
        ds = mdins.GetResultFromQuery(str)<br />
'in above statement i use class mdglobal which is created by me. and GetResultFromQuery return dataset<br />
<br />
        ComboBox1.DataSource = ds.Tables(0)<br />
        ComboBox1.DisplayMember = "AreaName"<br />
        ComboBox1.ValueMember = "Areaid"<br />
        ComboBox1LoadTime = False<br />
        ComboBox1.SelectedIndex = -1


Now on selected index change event of combobox1 use following code
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged<br />
        If Not ComboBox1LoadTime And ComboBox1.Text.Trim <> "" Then<br />
            Dim str As String<br />
            Dim mdins As New mdGlobal<br />
<br />
            ComboBox2.DataSource = Nothing<br />
            If Not ds1 Is Nothing Then<br />
                ds1.Dispose()<br />
            End If<br />
<br />
            str = "select iteminfo.itemid,itemname,area_item.areaid from iteminfo,area_item where iteminfo.itemid=area_item.itemid and area_item.areaid=" & ComboBox1.SelectedValue<br />
            ds1 = New DataSet<br />
            ds1 = mdins.GetResultFromQuery(str)<br />
<br />
            ComboBox2.DataSource = ds1.Tables(0)<br />
            ComboBox2.DisplayMember = "itemName"<br />
            ComboBox2.ValueMember = "itemid"<br />
        End If<br />
    End Sub


Please take care that,in above code i use sample query and my own method for fill dataset

hope this helps

Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)

My Company

GeneralRe: Correct way to filter a databound combobox based on selection in other databound combobox? Pin
Gr1mR33p3r11-May-08 22:38
Gr1mR33p3r11-May-08 22:38 
QuestionRetrieve data from MySQL and Check the data if anything exited Pin
drexler_kk11-May-08 17:06
drexler_kk11-May-08 17:06 
AnswerRe: Retrieve data from MySQL and Check the data if anything exited Pin
Alsvha11-May-08 20:45
Alsvha11-May-08 20:45 
GeneralRe: Retrieve data from MySQL and Check the data if anything exited Pin
drexler_kk11-May-08 21:50
drexler_kk11-May-08 21:50 
AnswerRe: Retrieve data from MySQL and Check the data if anything exited Pin
CodingYoshi11-May-08 20:46
CodingYoshi11-May-08 20:46 
GeneralRe: Retrieve data from MySQL and Check the data if anything exited Pin
drexler_kk11-May-08 21:56
drexler_kk11-May-08 21:56 
QuestionHELP What are Properties and Control properties? Pin
peachqueenoh11-May-08 15:08
peachqueenoh11-May-08 15:08 
AnswerRe: HELP What are Properties and Control properties? Pin
Christian Graus11-May-08 15:39
protectorChristian Graus11-May-08 15:39 
GeneralRe: HELP What are Properties and Control properties? Pin
peachqueenoh11-May-08 16:07
peachqueenoh11-May-08 16:07 
GeneralRe: HELP What are Properties and Control properties? Pin
Christian Graus11-May-08 16:08
protectorChristian Graus11-May-08 16:08 
AnswerRe: HELP What are Properties and Control properties? Pin
Ray Cassick11-May-08 17:26
Ray Cassick11-May-08 17:26 
QuestionHow to: Display an Image in an Individual Cell of the DataGridView (Visual Basic) Pin
Graham Irons11-May-08 14:34
Graham Irons11-May-08 14:34 
AnswerRe: How to: Display an Image in an Individual Cell of the DataGridView (Visual Basic) Pin
Dave Kreskowiak12-May-08 5:06
mveDave Kreskowiak12-May-08 5:06 
GeneralRe: How to: Display an Image in an Individual Cell of the DataGridView (Visual Basic) Pin
Graham Irons12-May-08 16:04
Graham Irons12-May-08 16:04 
QuestionNamespace Warning Pin
dBrong11-May-08 14:08
dBrong11-May-08 14:08 
AnswerRe: Namespace Warning Pin
Dave Kreskowiak12-May-08 5:04
mveDave Kreskowiak12-May-08 5:04 
QuestionGrouping dates by week...Is it possible? Pin
Mikjall11-May-08 12:59
Mikjall11-May-08 12:59 

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.