vendredi 25 novembre 2016

ASP.net: how to store array of day checkboxes into MSSQL?

Good day. MSDN says that bit MSSQL datatype mapping onto bool C# datatype. ASP.net map checkbox onto bool, if i currently understand. And i need to store set of checkboxes states (bool[]).

Constants.cs contains this line:

public static string[] Days => new string[] { "Su", "Mo", "Tu", "We", "Th", "Fr", "Sa" };

View.cshtml contains this:

@foreach (var day in Constants.Days)
{
    <div class="form-group">
        <label class">@day</label>
        <input name="Days" type="checkbox" class="checkbox-inline" />
    </div>
}

And this, i think, will be mapped on bool[]. But here is no possible ways to store bool array in db? Or how to store set of checkboxes states in Db?




Aucun commentaire:

Enregistrer un commentaire