执行结果总是出现错误,请帮忙更正一下,谢谢
using System;using System.Collections.Generic;
using
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient ;
namespace XSXK
{
public partial class 学生信息查询 : Form
{
DataSet ds = new DataSet();
SqlClient.SqlDataAdapter adp;
BindingManagerbase bingpage;
public 学生信息查询()
{
InitializeComponent();
}
private void 学生信息查询_Load(object sender, EventArgs e)
{
string strconn = "server=localhost;uid=sa;pwd=; database=studencourse";
SqlConnection conn = new SqlConnection(strconn);
string strSql = "select * from Students";
SqlDataAdapter adp = new SqlDataAdapter(strSql, conn);
adp.Fill(ds, "Students");
dataGridView1.DataSource = ds.Tables["students"];
bingpage = this.BindingContext[ds, "Students"];
textBox2.DataBindings.Add(new Binding("text", ds, "students.sno"));
textBox1.DataBindings.Add(new Binding("text", ds, "students.sname"));
textBox3.DataBindings.Add(new Binding("text", ds, "students.ssex"));
textBox4.DataBindings.Add(new Binding("text", ds, "students.Sbircthday"));
textBox4.Text = DateTime.Parse(textBox4.Text);
textBox5.DataBindings.Add(new Binding("text", ds, " students.sdept"));
richTextBox1.DataBindings.Add(new Binding("text", ds, " students.memo"));
label8.Text = (bingpage.Count - 1);
if (bingpage.Connt > 0)
{
label11.Text = "1";
}
comboBox1.Items.Add("学号");
comboBox1.Items.Add("姓名");
comboBox1.Items.Add("院系名称");
}
}
}
错误 1 找不到类型或命名空间名称“BindingManagerbase”(是否缺少 using 指令或程序集引用?
错误 2 无法将类型“System.DateTime”隐式转换为“string”