here is the code and the problem is that the second reader i.e ReadGroup
Fail to read data
code:-
int TabID, GroupID, ItemID, ControlID;
String TabName, TabCaption, GroupName, GroupCaption, ItemName, ItemCaption, ControlName, ControlCaption;
string conn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=ui.mdb";
OleDbConnection connst = new OleDbConnection(conn);
connst.Open();
string str = "select * from Tabs ";
while (DataReader.Read())
{
TabID = Convert.ToInt32(DataReader[0]);
TabName = DataReader[1].ToString();
TabCaption = DataReader[2].ToString();
TabHome = RibbonBar.InsertTab(TabID, TabCaption);
TabHome.Id = TabID;
string str1 = "select * from Groups where Tab_ID=" + TabID;
OleDbCommand CmdGroup = new OleDbCommand(str1, connst);
OleDbDataReader ReadGroup = CmdGroup.ExecuteReader();
ReadGroup.Read();
Console.WriteLine(ReadGroup.HasRows);
while (ReadGroup.Read())
{
GroupID = Convert.ToInt32(ReadGroup[0]);
GroupName = ReadGroup[1].ToString();
GroupCaption = ReadGroup[2].ToString();
Tests = TabHome.Groups.AddGroup(GroupCaption, GroupID);
//for (int k = j; k <= i; k++)
//{
string str2 = "select * from Items where Group_id=0";
OleDbCommand CmdControls = new OleDbCommand(str2, connst);
OleDbDataReader ReadControl = cmd.ExecuteReader();
while (ReadControl.Read())
{
ControlID = Convert.ToInt32(ReadControl[0]);
ControlName = ReadControl[1].ToString();
XtremeCommandBars.XTPControlType typ = (XtremeCommandBars.XTPControlType)ControlID;
Tests.Add(typ, ControlID, ControlName, false, false);
Console.WriteLine(XtremeCommandBars.XTPControlType.xtpControlButton.GetTypeCode());
int lm;
lm = Convert.ToInt32(typ.GetTypeCode());
}
}
//}
}