无法将类型字符串隐式转换为 System.Windows.Forms.DataGridViewTextBoxColumn

Lax*_*ite 1 c# windows asp.net

我已经尝试了以下解决方案,但仍然给我同样的错误: 无法隐式地将类型“string”转换为“System.Windows.Forms.TextBox”

这是我的表单元素代码:

 private void InitializeComponent()
{
         this.Controls.Add(this.splitContainer1);
            this.ImeMode = System.Windows.Forms.ImeMode.On;
            this.Name = "UserForm"; // Here I have a problem while runing the application
            this.Text = "User Log Management";
}
Run Code Online (Sandbox Code Playgroud)

我尝试更改表单的名称,但仍然不起作用。

这是代码快照: 这是代码快照 谢谢

小智 5

表单中的文本框之一的 ID 为“Name”。将其重命名为“txtName”,您的代码应该可以正常工作