using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Reflection;
using System.IO;
using NodaTime;
namespace MyApp
{
public partial class MainForm : Form
{
public class Foo
{
private LocalDateTime date_time;
public Foo(string data)
{
Int32 i;
char[] delimiters = { ',', '/', ':' };
string[] tokens = data.Split(delimiters);
if( Int32.TryParse(tokens[0], out i ))
{
date_time.Month = i;
}
}
};
public MainForm()
{
InitializeComponent();
}
}
}
The line where I set date_time.Month to i is where I get the error called out in the title - Property or indexer cannot be assigned to -- it is read only. I've searched through many of the similar posts, but wasn't able to find a solution. Any help would be greatly appreciated. Thanks in advance!