After approximately 40 seconds of running this code and inserting ~400 records into the table I get a
OleDbException was Unhandled - Unspecified Error.
A copy of the code:
clsDBConnector dbConnector = new clsDBConnector();
OleDbDataReader dr;
string sqlStr;
dbConnector.Connect();
sqlStr = " SELECT MAX(EventID) AS MaxID" +
" FROM Events";
dr = dbConnector.DoSQL(sqlStr);
while (dr.Read())
{
EventID = Convert.ToInt16( dr[0].ToString());
}
dr.Close();
sqlStr = " SELECT MemberID" +
" FROM GroupMembers" +
" WHERE (GroupID = " + GroupID + ")";
dr = dbConnector.DoSQL(sqlStr);
while (dr.Read())
{
MemberID = Convert.ToInt16( dr[0].ToString());
clsDBConnector dbConnectorInsert = new clsDBConnector();
string cmdStr = "INSERT INTO EventsAtendees " +
"(MemberID, EventID) " +
"VALUES (" + MemberID + ", " + EventID + ")";
dbConnectorInsert.Connect();
dbConnectorInsert.DoDML(cmdStr);
dbConnectorInsert.close();
}
dr.Close();
I have taken out the custom fields and variables to make this more useable by everyone.