The following is the piece of code i have tried to list down the projects for a domain in ALM and i am getting the following error message
Indexed property 'ITDConnection11.VisibleProjects' has non-optional arguments which must be provided
The error message is shown on this line of code
List proj = qctd.VisibleProjects;
I am struck now and not sure how to progress on this.. Could you please help me on this?
What I have tried:
using System;
using System.Windows.Forms;
using MetroFramework.Forms;
using MetroFramework;
using TDAPIOLELib;
namespace ALM___Utilities
{
public partial class Form1 : MetroForm
{
public Form1()
{
InitializeComponent();
}
private void ALM_url_TextChanged(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(ALM_url.Text) & string.IsNullOrEmpty(Username.Text) & string.IsNullOrEmpty(Password.Text))
loginbutton.Enabled = true;
else
loginbutton.Enabled = false;
}
private void loginbutton_Click(object sender, EventArgs e)
{
string username = Username.Text;
string password = Password.Text;
string URL = ALM_url.Text;
TDConnection qctd = new TDConnection();
qctd.InitConnectionEx(URL);
try
{
qctd.Login(username, password);
if (qctd.Connected)
{
MetroMessageBox.Show(this, "Logged in Successfully", "Login Status", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
List domainlist = qctd.VisibleDomains;
List proj = qctd.VisibleProjects;
foreach (string desc in domainlist)
{
foreach ( var projname in proj)
{
MetroMessageBox.Show(this, desc.ToString(), "domain", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
{
}
}
}
catch (Exception ex)
{
MetroMessageBox.Show(this, ex.Message, "Login Status", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
}