Re: Combo box refresh



"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


.



Relevant Pages

  • Re: Hi
    ... Regards ... Richard Blewett - DevelopMentor ... Checked by AVG anti-virus system. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: passing parameter to thread ??
    ... Diving in before Jon does;-) ... Regards ... Richard Blewett - DevelopMentor ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Strong name trouble
    ... > Richard Blewett - DevelopMentor ... >> My code DOES NOT WORK if assemblies ARE strong name. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Messagebox.Show refresh
    ... Regards ... > Richard Blewett - DevelopMentor ... > In a C# application I use a message box to display an error. ...
    (microsoft.public.dotnet.framework)
  • Problem in using Assembly CreateInstance
    ... Is ManWrapper in a namespace? ... Regards ... Richard Blewett - DevelopMentor ...
    (microsoft.public.dotnet.languages.csharp)

Loading