WinTD is a great program, but there are a couple of things I don’t like about it, and, being a programmer, I’ve long wanted to create my own version. I was getting a lot done on it last year, when work got a bit weird and I put aside some of my “outside” projects. Well, I have a new job, and I decided it was time to pick them up again.
One of my frustrations was that a tourney running program really has to work well with the ratings supplement files from USCF. In order to do that, I had to understand what the format of those files were, and I couldn’t find any published documentation. I did some work figuring out how to open the files up and see what’s in them. It wasn’t exactly arduous, but it took some hours to do. To save others the “getting started” portion of similar efforts, I’ve decided to share the results of my work.
I work with Visual Studio and the .NET Framework. The following code is provided “as is” with no support from anyone, and
without the blessing of the USCF. If it doesn’t work, blame me, not them. (And then, write one that does work and send me
the code.) It might work now, it might not.
It might work next month. It might not. My guess work about the contents of the rating supplement might be right. It might not.
Who knows? It’s just a hobby program, but it might be useful to others who, like me, might be interested in making a program
of their own which, although it doesn’t have the bells and whistles of SwissSys or WinTD, would work just fine for our tournaments.
Here’s the code. The code opens the “golden database” ratings file, creates a DataSet object, and stores the schema for that database. Good luck. I hope it works, but it will undoubtedly stop working whenever the USCF decides to make a change in the ratings supplement file. For now, it looks like it is working.
To begin, download the golden database file, and unzip it. The .DBF is called taratsup.dbf.
private void button1_Click(object sender, EventArgs e)
{if (openFileDialog1.ShowDialog()== System.Windows.Forms.DialogResult.OK)
{
string dirname = openFileDialog1.FileName.Remove(openFileDialog1.FileName.LastIndexOf(‘\’));
string filename = openFileDialog1.FileName.Substring (openFileDialog1.FileName.LastIndexOf(‘\’) + 1);
if (filename.ToUpper() != "TARATSUP.DBF")
{
MessageBox.Show("The file should be named TARATSUP.DBF");
return;
}
string ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" + dirname + ";Extended Properties=dBase III";
System.Data.OleDb.OleDbDataAdapter da = new System.Data.OleDb.OleDbDataAdapter("Select * from " + filename, ConnectionString);
System.Data.DataSet ds = new DataSet();
da.Fill(ds);//ds now contains a dataset of all the rows from the golden database
if (saveFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
ds.WriteXmlSchema(saveFileDialog1.FileName);
}
}
}
When you run the above, it will create a dataset with the appropriate contents, and save the database schema to a file. If you look at that file, here are the contents.
<?xml version="1.0" standalone="true"?>-<xs:schema xmlns:msdata=“urn:schemas-microsoft-com:xml-msdata” xmlns:xs=“http://www.w3.org/2001/XMLSchema” xmlns=“” id=“NewDataSet”>
-<xs:element msdata:UseCurrentLocale=“true” msdata:IsDataSet=“true” name=“NewDataSet”>
-xs:complexType -<xs:choice maxOccurs=“unbounded” minOccurs=“0”>
-<xs:element name=“Table”>
-xs:complexType
-xs:sequence
<xs:element name=“MEM_ID” minOccurs=“0” type=“xs:string”/>
<xs:element name=“MEM_NAME” minOccurs=“0” type=“xs:string”/>
<xs:element name=“EXPIRED” minOccurs=“0” type=“xs:dateTime”/>
<xs:element name=“STATE” minOccurs=“0” type=“xs:string”/>
<xs:element name=“RSUPP_YR” minOccurs=“0” type=“xs:string”/>
<xs:element name=“RSUPP_NUM” minOccurs=“0” type=“xs:string”/>
<xs:element name=“R_PLR_TYP” minOccurs=“0” type=“xs:string”/>
<xs:element name=“R_LPB_RAT” minOccurs=“0” type=“xs:string”/>
<xs:element name=“R_NRM_DAT” minOccurs=“0” type=“xs:string”/>
<xs:element name=“Q_PLR_TYP” minOccurs=“0” type=“xs:string”/>
<xs:element name=“Q_LPB_RAT” minOccurs=“0” type=“xs:string”/>
<xs:element name=“Q_NRM_DAT” minOccurs=“0” type=“xs:string”/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
It’s a single table, with rows that contain twelve columns.
Column 0 - The USCF Member ID, stored as a string.
Column 1 - The USCF Member name, the same as it appears on the membership card, which is intended to be lastname, firstname
Column 2 - The expiration date of the member. 12/31/2099 appears to indicate a life member.
column 3 - The member’s state, as a two letter string
column 4 - I believe this is the last year in which this member’s rating changed in a ratings supplement, as a four character string
column 5 - RSUPP_NUM - the number of the month of the last rating supplement for this member, as a two character string.
i.e. January is indicated by “01”. December is indicated by “12”.
column 6 - The regular rating type. A single character string. “U” is unrated. “P” is provisional. “E” is a normal rating.
column 7 - The regular rating, as a four digit string, with a leading space if necessary.
i.e. 838 is " 838".
column 8 - R_NRM_DAT I don’t know. All values appear to be null.
column 9 - as with column 6, but for quick ratings.
column 10 - as with column 7, but for quick ratings.
column 11 - as with column 8, and it also appears all entries are null.
From there, it’s up to you to manipulate the data.
As I go forward, I might post more of my code, if I think it’s reusable elsewhere.