Football Rating Program Using DataTable and DataRow Objects in C# Dot Net
The initial step is to import information from a csv record (comma delimited text document) and burden it memory of my program so I can often get to it without opening an outside document each time. I will likewise have to run inquiries on this information to perform searches and computations. The item DataTable in ADO.net suits this reason. Whenever I have made my table I want to characterize the segments I need and the properties of these segments. The outcomes document is in the accompanying configuration Host group, Away group, home objectives, away objectives teamA , Team B, 1, 0 teamD , Team C, 4, 0 teamF , Team E, 1, 1 I will call my table importResultsTable DataTable importResultsTable = new DataTable("imported"); Furthermore characterize every one of the sections I need in my table and add it to the table characterized previously. First make a segment to be added to the table DataColumn fht = new DataColumn(); Next pick what kind of information the section stores, for a group name it will be a string fht.DataType = System.Type.GetType("System.String"); Next pick what the segment making a beeline for show up in the table fht.ColumnName = "homeTeam"; lastly add it to our table importResultsTable.Columns.Add(fht); This code is rehashed for every segment that is added to our table DataColumn fat = new DataColumn(); at.DataType = System.Type.GetType("System.String"); at.ColumnName = "awayTeam"; importResultsTable.Columns.Add(fat); The following two segments are for the objectives scored by each team,these are whole number sorts. DataColumn hg = new DataColumn(); UFABET อันไหนดี hg.DataType = System.Type.GetType("System.Int32"); hg.ColumnName = "homeGoals"; importResultsTable.Columns.Add(hg); DataColumn ag = new DataColumn(); ag.DataType = System.Type.GetType("System.Int32"); ag.ColumnName = "awayGoals"; importResultsTable.Columns.Add(ag);

Leave a Reply

Your email address will not be published. Required fields are marked *