praktikantin
Goto Top

Combobox mit einer Gespeicherten Prozedur ausfüllen

Guten Abend,

ich habe ein kleines Problem. Ich habe ein kleines Programm entwickelt das nicht läuft... Ich versuche mit Hilfe einer Gespeicherten Prozedur eine Combobox mit Values auszufüllen. Leider klappt es nicht und ich bekomme nichts in meine Combobox rein... Der Code --

      Dim con As New SqlClient.SqlConnection

        con.ConnectionString = AppSettings.Get("connString")  

        Dim cmd As New SqlCommand
        cmd.CommandType = CommandType.StoredProcedure
        cmd.CommandText = "SP_Find_B29_Stores"  
        cmd.Connection = con
        Dim ds As New DataSet
        Dim da As SqlDataAdapter = New SqlDataAdapter(cmd)
        da.Fill(ds)
        With ComboBox1
            .DataSource = ds
            .DisplayMember = "name"  
            .ValueMember = "organ_id"  
            .SelectedIndex = 0
        End With


Die Prozedur

ALTER   PROCEDURE [dbo].[SP_Find_B29_Suppliers] 

as
begin

select 	op.organ_id as organ_id, o.name as name
from 	organ_params op
	inner join organizations o		
		on op.organ_id=o.organ_id
order by name 

Kann mir jemand sagen was ich da Falsch mache???

Vielen lieben dank!!!

Praktikanin

Content-Key: 118436

Url: https://administrator.de/contentid/118436

Printed on: April 20, 2024 at 02:04 o'clock