Topic
  • No replies
SystemAdmin
SystemAdmin
1883 Posts

Pinned topic how can I change variable value in .dat from .det application

‏2012-12-19T14:00:52Z |
Hey guys!
Here i came cross a problem:
I want to change the int variable:MIdNum, which i defined in my model from .det application
The followings are my .dat code and .net code:
-----------.dat code:----------------------
DBConnection db("access","oilDB.mdb");
Gasolines,Gas from DBRead(db,"SELECT name,name,demand,price,octane,lead FROM GasData where Id = ?")(MIdNum);
-----------.det code:----------------------
OplModel opl = oplF.CreateOplModel(def,cplex);
OplDataElements dataElements = oplF.CreateOplDataElements();
dataElements.AddElement(dataElements.MakeElement("MIdNum", 2));
opl.AddDataSource(dataElements);
OplDataSource dataSource = oplF.CreateOplDataSource(System.Environment.CurrentDirectory + @"\oilDB2.dat");
opl.AddDataSource(dataSource);
opl.Generate();
but i always failed.
thank you !!