Re: Combo box refresh
- From: "Richard Blewett [DevelopMentor]" <richard at nospam dotnetconsult dot co dot uk>
- Date: Wed, 9 Nov 2005 10:27:57 -0000
"Doug" <queanbeyan@xxxxxxxxxxx> wrote in message
news:4371c558$0$25858$afc38c87@xxxxxxxxxxxxxxxxxxxxxxx
> Most probably you are correct - but can you explain how i could clear the
> old items out?
>
> I am filling the combo box with ...
>
> private void PopulateDatasetList(string libname)
>
> {
>
> string server = "";
>
> SAS.Workspace ws = null;
>
> try
>
> {
>
> server = consumer.AssignedServer;
>
> ws = consumer.Workspace(server) as SAS.Workspace;
>
> }
>
> catch (Exception ex)
>
> {
>
> throw new System.Exception("ISASTaskConsumer.Workspace is not
> usable!",ex);
>
> }
>
> if (server.Length>0 && ws!=null)
>
> {
>
> ADODB.Recordset adorecordset = new ADODB.RecordsetClass();
>
> ADODB.Connection adoconnect = new ADODB.ConnectionClass();
>
> try
>
> {
>
> adoconnect.Open("Provider=sas.iomprovider.1; SAS Workspace ID=" +
>
> ws.UniqueIdentifier, "", "", 0);
>
> string selectclause = "select memname, memtype from sashelp.vmember where
> libname='" + libname + " ' and memtype = 'DATA'";
>
> adorecordset.Open( selectclause, adoconnect,
>
> ADODB.CursorTypeEnum.adOpenForwardOnly, ADODB.LockTypeEnum.adLockReadOnly,
> (int) ADODB.CommandTypeEnum.adCmdText);
>
> OleDbDataAdapter da = new OleDbDataAdapter();
>
> da.Fill(dsVMember, adorecordset, "vmember"); }
>
> catch
>
> { }
>
> finally
>
> { adoconnect.Close(); }}}
>
>
>
> and then using
>
> private void cmbMembers_SelectedIndexChanged(object sender,
>
> System.EventArgs e)
>
> {
> members=((DataRowView)cmbMembers.SelectedItem).Row.ItemArray[0].ToString();
> }
>
>
>
>>
>> How are you triggering the fill of combobox B? Are you sure you're not
>> just forgetting to clear out the old items before adding the new ones?
>>
>> Regards
>>
>> Richard Blewett - DevelopMentor
>> http://www.dotnetconsult.co.uk/weblog
>> http://www.dotnetconsult.co.uk
>>
>
>
Your sample code is incomplete.
In PopulateDatasetList how is this populating the combobox? is it databound?
In the event handler what is "members"?
Regards
Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk
.
- References:
- Re: Combo box refresh
- From: Richard Blewett [DevelopMentor]
- Re: Combo box refresh
- Prev by Date: Re: Combo box refresh
- Next by Date: Windows service not getting uninstalled.
- Previous by thread: Re: Combo box refresh
- Next by thread: Windows service not getting uninstalled.
- Index(es):
Relevant Pages
|
Loading