MapXtreme2004 code reads the elements in the TAB table
For example, use notepad to open the TAB file "Ranan. Tab" to be accessed, you can see the following:
! Table! TABLE
Version 300
Charset WindowssimpCHinese
Definition Table
Type Native Charset "WindowsSimpCHINESE"
FIELDS 2
Geographical Code Char (10) Index 1;
Name Char (10);
Let's take a look at all "name" elements of the table. And add it to the DropDownList control.
Private static string _findlayername = "Ranan";
Private static string _findcolumnname = "name";
MapInfo.data.Table Table = mapinfo.Engine.Session.current.catalog.getTable (_FindlayerName);
IF (Table! = NULL)
{
MidataReader TR;
MicroNection Con = New MicroNection ();
MicMmand tc = con.createCommand ();
Tc.commandtext = "SELECT" _FindColumnName "from" _findlayername;
C.Open ();
Tr = tc.executeReader ();
While (Tr.Read ())
{
DropDownList1.Items.Add (tr.getstring (0));
}
Tc.cancel ();
Tc.dispose ();
Tr.Close ();
C. close ();
}