我是学生,我不知道是什么partial class.以下代码属于部分类
我自动创建了分部类:
public partial class EGUI: Form
{
private OleDbConnection dbConn; // Connectionn object
private OleDbCommand dbCmd; // Command object
private OleDbDataReader dbReader; // Data Reader object
private Emp Edetails;
private string sConnection;
private string sql;
}
Run Code Online (Sandbox Code Playgroud) 我为foreach收到以下错误
Foreach语句不能对'object'类型的变量进行操作,因为'object'不包含'GetEnumerator'的公共定义
我正在进行任何语法错误
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication6
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Namepopu_SelectedIndexChanged(object sender, EventArgs e)
{
// this.textBox1.Text = Namepopu.Text;
// this.textBox1.Text = " ";
foreach (int i in Namepopu.SelectedItem)
this.textBox1.Text += Namepopu.Text[i];
{
}
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
}
Run Code Online (Sandbox Code Playgroud)