लोड हो रहा है कॉम्बो बॉक्स से एक टेबल coulmn नाम कर रहे हैं कि केवल संख्या

0

सवाल

मैं एक मेज है जिसका स्तंभ नाम संख्या कर रहे हैं केवल. अब मैं करने के लिए की जरूरत popuate एक कॉम्बो बॉक्स है कि टेबल के आधार पर चयनित मूल्य के anothe comcbo बॉक्स "नाम cboStandard" लेकिन यह है trigerring त्रुटि है कि "बच्चे की सूची के लिए क्षेत्र 2 नहीं बनाया जा सकता". नायब: इस तालिका में स्तंभ नाम निर्धारित कर रहे हैं से मूल्य में चयनित cboStandard कॉम्बो बॉक्स नीचे है मेरे कोड को पॉप्युलेट करने के लिए कॉम्बो बॉक्स:

**Dim Series As String = (cboStandard.Text).Substring((cboStandard.Text).IndexOf(" ") + 1, 3)
        If Not Series.Contains("Sys") Then
            Dim getWeights As String = "Select [" & Series & "] from StandardChicken where [" & Series & "] > 0 "
            loadcombo(getWeights, cboStandardWeights, Series)
            Dim dt As New DataTable()
            dt = ret.LoadDataTable2(getWeights)
            If Not (dt.Rows.Count = 0) Then
                cboStandardWeights.DataSource = dt
                cboStandardWeights.DisplayMember = Series
                cboStandardWeights.ValueMember = Series
                cboStandardWeights.AutoCompleteSource = AutoCompleteSource.ListItems
                

            ElseIf dt.Rows.Count = 0 Then
                cboStandardWeights.Text = ""
                cboStandardWeights.DataSource = dt
                cboStandardWeights.ValueMember = Series
                cboStandardWeights.DisplayMember = Series
                cboStandardWeights.AutoCompleteSource = AutoCompleteSource.ListItems
            End If**
 
columnname combobox sql vb.net
2021-11-20 09:48:43
1

सबसे अच्छा जवाब

0

क्या निम्न:

private sub comboBox1_EditvalueChanged(sender As Object, e As EventArgs) Handles comboBox1.EditValueChanged
  dim myValue = CInt(comboBox1.EditValue)
  if myValue = 1 then
    'populate comboBox2
  else if myValue = 2
    'populate comboBox2 with other stuff
  end if
end sub

बहुत आसान है. आप कर सकते हैं जो आप चाहते हैं अंदर, आप कर सकते हैं यहां तक कि छिपाने के लिए और दिखाने के दूसरे comboBox

2021-11-22 11:32:48

अन्य भाषाओं में

यह पृष्ठ अन्य भाषाओं में है

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................

इस श्रेणी में लोकप्रिय

लोकप्रिय सवाल इस श्रेणी में