Hi,
How do i pass an argument from a previous wizard page?
The first wizard page has one input field (DataSource), whereas the next wizard page provides a list of databases given on the basis of the datasource.
The first wizard page has one input field - DataSource
<
Argument Name="DataSource">
<
ValueProvider Type="Evaluator" Expression="Mickey\Dev2005" />
</
Argument>
The second wizard uses my customTypeConverter(AutoDalListOfDBTypeConverter ) to show the list of databases.
<Argument Name="DatabaseName">
<
Converter Type="Test.Converters.AutoDalListOfDBTypeConverter, Test"/>
</
Argument>
The problem is, how do I pass the DataSource value from wizardPage 1 to my custom TypeConverter for wizardPage 2?
public class AutoDalListOfDBTypeConverter : TypeConverter
{
public override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
{
m_listOfDB.Clear();
String conxString = "Data Source= " + DataSource + "; Integrated Security=SSPI;";
using (SqlConnection sqlConx = new SqlConnection(conxString))
{
sqlConx.Open();
DataTable tblDatabases = sqlConx.GetSchema("Databases");
sqlConx.Close();
foreach (DataRow row in tblDatabases.Rows)
{
m_listOfDB.Add(row["database_name"].ToString());
}
}
m_listOfDB.Sort();
return new StandardValuesCollection(m_listOfDB);
}
}
Thanks in advanced,
Nima