【发布时间】:2019-10-18 20:11:57
【问题描述】:
我是 C# 新手。我从 NuGet https://www.nuget.org/packages/Common.CheckComboBox/(带有组合框的多个复选框)安装了一个库。如果选中该复选框,则在 SQL Server 中插入 1,否则在 SQL Server 中插入 0。在普通复选框中,我知道如何插入数据,但它在组合框中的多个复选框帮助我解决了问题。
代码:
string[] color = new string[6] { "Blue", "Red", "Orange", "Pink", "White","Grey" };
for (int i = 0; i < color.Length; i++)
{
checkedComboBox1.Items.Add(color[i]);
}
checkedComboBox1.SetItemChecked(1, true);
【问题讨论】:
-
你用什么访问SQL数据库?您使用的是 .NET Framework SqlClient、EntityFramework 还是其他?你试过什么了。这有点模糊。
-
.NET Framework SqlClient,