我不能够做的INSERT,UPDATE,DELETE和我在的WinForms ListView的CLEAR operatopns显示的ListView错误
这里是我的代码:
private void Form1_Load(object sender, EventArgs e)
{
ShowData();
}
private void ShowData()
{
SqlConnection con = new SqlConnection("User id=sa;[email protected];database=arvind;server=ASHOK-PC");
con.Open();
SqlCommand cmd = new SqlCommand("select * from Login_1",con);
DataTable dt = new DataTable();
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(dt);
listView1.DataContext = dt.DefaultView;
}
我在DataContext的有误差
System.Windows.Forms.ListView does not contain a definition for datacontext and no extension method accepting a first argument of type System.Windows.Forms.Listview could be found.
哦,我很抱歉,因为它..但我正在尝试代码,并得到了一些如何激怒..所以..hope不要介意plz .. – user3278187