有SQL SERVER2005数据库PUBS,PUBS库中有一表UserLogin,表结构如下:UserName Varchar(50) PrimaryKeyPassword Varchar(20) 阅读下面的WINFORM(C#)代码:private void button1_Click (object sender, System.EventArgs e){ SqlConnection myConn = new SqlConnection("Server=(local);uid=sa;pwd=;Database=pubs");try{ myConn.Open(); SqlDataAdapter da = new SqlDataAdapter(" Select UserName, password from UserLogin ", myConn); DataSet ds = new DataSet(); da.Fill(ds, "UserLogin"); DataRow dr = ds.Tables["UserLogin"].NewRow(); dr["UserName"] = DateTime.Now.Ticks.ToString(); dr["password"] = DateTime.Now.Ticks.ToString(); ds.Tables["UserLogin"].Rows.Add(dr); ds.AcceptChanges(); da.Update(ds, "UserLogin");}catch(SqlException ee){ MessageBox.Show(ee.Message.ToString());}finally{ myConn.Close();}}假设命名空间引用、窗体初始化、连接数据库全部正确,则点击按钮button1,执行结果为(选一项)
B.
报错,ds.AcceptChanges()与da.Update(ds, “UserLogin”)不能同时用
C.
不报错,但没有将数据记录增加到UserLogin表中
D.
报错,不能用DateTime.Now.Ticks.ToString()给字段赋值