BookmarkSubscribeRSS Feed
Smgduarte
Calcite | Level 5

Good morning community,

 

I'm currently trying to migrate an AddIn developed in VB2010 from version 4.1 to 5.1 of Enterprise Guide.

 

The reason I request your aid today is due to this error: "Error 2 The name 'sasDataSetEDR' does not exist in the current context 'path' ". While using version 4.1 I had it declared as "private SAS.EG.Controls.SASDatasetSelector xpto", but sadly using version 5.1 it doesnt use the same dll file.

 

Could you please guide me through, on which dll to properly use in order to have the same functionality.

 

Thanks.

 

Best Regards,

 

Sérgio Duarte

2 REPLIES 2
ChrisHemedinger
Community Manager

Instead of embedding a control, later versions of EG provide an API (ShowOutputDataSelector) that allows you to invoke the EG data selector directly.  There is an example in the SAS Running Totals task (GitHub).  Looks something like this:

 

 

// Allow user to browse to output data location
private void btnBrowseOut_Click(object sender, EventArgs e)
{
	// this calls back into application
	// and tells it to display browse dialog
	string cookie = "";
	ISASTaskDataName od = Consumer.ShowOutputDataSelector(this,
		ServerAccessMode.OneServer,
		Consumer.AssignedServer,
		"", "", ref cookie);

	// the ShowOutputDataSelector doesn't return
	// a cancel status.  So if it produces
	// a null value, that tells us it was
	// Cancel'd
	if (od != null)
	{
		txtOutput.Text = 
			string.Format("{0}.{1}", od.Library, od.Member);
	}
}

 

SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!
Smgduarte
Calcite | Level 5

I'm not sure it fixes my problem. lets consider I have the code bellow how could I migrate from 4.1 to 5.1 and which dll's do I need:

 

 

" private SAS.EG.Controls.SASDatasetSelector sasDataSetEDR;

 

......

SASDatasetSelector sasDataSet = new SASDatasetSelector();

 

sasDataSet.Server = servidor;
sasDataSet.Consumer = consumer;
sasDataSet.Parent = contentor;

 

......(add some resources)

 

contentor.Controls.Add( sasDataSet);  //  this dataser is being added to a form

sasDataSet.Show();

return sasDataSet; "

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1332 views
  • 0 likes
  • 2 in conversation