我不断隐藏第二个预填充的这个错误...不能隐含地将类型字符串转换为System.Collections.Generic.IEnumerable,我不确定我做错了什么。无法隐式转换类型字符串
namespace HomeInventory2
{
public partial class Form1 : Form
{
public Form1(string prepopulated)
{
InitializeComponent();
IEnumerable<String> lines = prepopulated;
textBoxAmount.Text = lines.ElementAtOrDefault(0);
textBoxCategories.Text = lines.ElementAtOrDefault(1);
textBoxProperties.Text = lines.ElementAtOrDefault(2);
textBoxValue.Text = lines.ElementAtOrDefault(3);
}
private void label1_Click(object sender, EventArgs e)
{
}
private void submitButton_Click(object sender, EventArgs e)
{
CreateInventory create = new CreateInventory();
create.ItemAmount = textBoxAmount.Text;
create.ItemCategory = textBoxCategories.Text;
create.ItemProperties = textBoxValue.Text;
create.ItemValue = textBoxValue.Text;
InventoryMngr invtryMngr = new InventoryMngr();
invtryMngr.Create(create);
}
}
你阅读的信息? – SLaks
它是编译错误还是运行时错误? – Ikaso
什么是“预填充”填充?你期望在'行'中有什么? –