7. Juni 2010 17:35
public void FillListBox()
{
NavisionNetType NetType;
NavisionDriverType DriverType;
NavisionValue Data;
DriverType = NavisionDriverType.Sql;
NetType = NavisionNetType.SqlDefault;
CFrontDotNet.DriverType = DriverType;
int CT; // Aktuelle Tabelle.
int CR; // Aktueller Datensatz.
String Item;
CFrontDotNet.NavisionPath = "C:\\Program Files (x86)\\Microsoft Dynamics NAV\\60\\Classic";
CFrontDotNet.Instance.ConnectServerAndOpenDatabase("CDE00075", NetType, "Cronus2009", 2000, true, true, "", "");
CFrontDotNet.Instance.OpenCompany("CRONUS AG");
CT = CFrontDotNet.Instance.OpenTable(50001);
CR = CFrontDotNet.Instance.AllocRecord(CT);
//CFrontDotNet.Instance.FindFirstRecord(CT, CR);
if (CFrontDotNet.Instance.FindRecord(CT, CR, "-"))
{
do
{
Item = CFrontDotNet.Instance.FieldToString(CT, CR, 1);
listBox1.Items.Add(Item);
}
while (CFrontDotNet.Instance.NextRecord(CT, CR, 1) !=0);
}
CFrontDotNet.Instance.FreeRecord(CR);
CFrontDotNet.Instance.CloseTable(CT);
CFrontDotNet.Instance.CloseCompany();
CFrontDotNet.Instance.CloseDatabase();
CFrontDotNet.Instance.DisconnectServer();
CFrontDotNet.Instance.Dispose();
}
8. Juni 2010 09:01
8. Juni 2010 10:31