khador Posted June 6, 2012 at 03:06 PM Report Share #460927 Posted June 6, 2012 at 03:06 PM Boas eu tenho uma listbox que carrega os dados da tabela Marcações a tabela tem os seguintes campos(N_marcacao,N_Cliente,N_Tratamento,Data,Hora). eu tenho uma listbox a carregar por N_Cliente mas queria mostrar la o Nome das pessoas que tem tratamentos marcados obrigado Link to comment Share on other sites More sharing options...
Caça Posted June 6, 2012 at 03:30 PM Report Share #460935 Posted June 6, 2012 at 03:30 PM Da mesma forma que estás a carregar o N_Cliente, carrega também o nome Pedro Martins Não respondo a duvidas por PM Link to comment Share on other sites More sharing options...
khador Posted June 6, 2012 at 03:48 PM Author Report Share #460945 Posted June 6, 2012 at 03:48 PM nao porque o Nome do cliente nao esta na tabela Marcações graficamente nao da e nao sei fazelo em run time :x Link to comment Share on other sites More sharing options...
Caça Posted June 6, 2012 at 04:01 PM Report Share #460953 Posted June 6, 2012 at 04:01 PM (edited) Vê isto http://www.w3schools.com/sql/sql_join_inner.asp Edited June 6, 2012 at 04:02 PM by Caça Pedro Martins Não respondo a duvidas por PM Link to comment Share on other sites More sharing options...
khador Posted June 6, 2012 at 04:04 PM Author Report Share #460956 Posted June 6, 2012 at 04:04 PM Vê isto http://www.w3schools..._join_inner.asp eu a query sei fazer so nao sei e o resto table adapters etc.. Link to comment Share on other sites More sharing options...
Caça Posted June 6, 2012 at 04:18 PM Report Share #460968 Posted June 6, 2012 at 04:18 PM Estas a utilizar um DataSet para trabalhares com a BD? Mostra um pouco de código. Pedro Martins Não respondo a duvidas por PM Link to comment Share on other sites More sharing options...
khador Posted June 6, 2012 at 04:22 PM Author Report Share #460973 Posted June 6, 2012 at 04:22 PM Em 06/06/2012 às 17:18, Caça disse: Estas a utilizar um DataSet para trabalhares com a BD? Mostra um pouco de código. código: //Captar os dados no evento quando a linha estiver selecionada DataRowView rwselecionada = (DataRowView)lbTratamentosMarcados.SelectedItem; if (rwselecionada != null) { txtNmarcacao.Text = rwselecionada.Row["N_Marcacao"].ToString(); cboNome.SelectedValue = rwselecionada.Row["N_Cliente"].ToString(); dtDataTratamento.Text = rwselecionada.Row["Data"].ToString(); cboHora.SelectedItem = rwselecionada.Row["Hora"].ToString(); lbTratamento.SelectedItem = rwselecionada.Row["N_tratamento"].ToString(); } estou a utilizar sim um DataSet, eu tenho graficamente feio(design-time) se clicar 2 vezes na listbox não aparece código apenas no form_load e q aparece: this.tratamentosTableAdapter.Fill(this.bdestetica_DataDataSet2.Tratamentos); Link to comment Share on other sites More sharing options...
Caça Posted June 6, 2012 at 04:26 PM Report Share #460978 Posted June 6, 2012 at 04:26 PM Então tens de adicionar uma query a essa tabela no DataSet, tal como tens a Fill, etc. Pedro Martins Não respondo a duvidas por PM Link to comment Share on other sites More sharing options...
khador Posted June 8, 2012 at 08:21 AM Author Report Share #461295 Posted June 8, 2012 at 08:21 AM soque a do Fill fiz em design-time, para fazer a query ja tem de ser em run-time penso eu mas vou tentar obrigado Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now