Click here to Skip to main content
15,890,845 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
C#
[WebMethod]
public Cascading DropDownNameValue[] GetColorsForModel (string knownCategoryValues,string category)
{
    String kv = CascadingDropDown.ParseKnownCategoryValuesString (knownCategoryValues);
    int modelId;
    if (!kv.ContainsKey("Model") || !Int32.TryParse(kv["Model"], out modelId))
    {
        return null;
    }
    CarsTableAdapters.ColorTableAdapter adapter = new CarsTableAdapters.ColorTableAdapter();
    Cars.ColorDataTable colorTable = adapter.GetColorsForModel(modelId);
    List<CascadingDropDownNameValue> values = new List<CascadingDropDownNameValue>();
    foreach (DataRow dr in colorTable)
    {
        values.Add(new CascadingDropDownNameValue((string) dr["Color"], dr["ColorID"].ToString()));
    }
Posted
Updated 15-Aug-11 9:21am
v2

Cascading is a nonexistent keyword, and you're missing the closing curly brace for the method. Even if Cascading represented one of your own classes, it's location is invalid. In essence, you're specifying two return types.
 
Share this answer
 
v2
For conversion try the online converters: here is one I use http://www.developerfusion.com/tools/convert/csharp-to-vb/[^]

The error message probably means it can't find the Cascading class - are you missing a reference, or a using statement?
 
Share this answer
 
Get rid of the misplaced space

C#
public CascadingDropDownNameValue[] GetColorsForModel (string knownCategoryValues,string category)


Get a clean compile.

Buy Reflector (it's cheep)

Open the DLL in that and decompile it into VB.

You'll have to clean up the code a bit but it works quickly.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900