问个错误
DataSet ds = new DataSet();ds.Tables.Add("Result");
SqlDataAdapter da = new SqlDataAdapter(strcom, conn);
da.Fill(ds, "Result"); 提示 错误"第 1 行: '.' 附近有语法错误。"
dataGridView1.AutoGenerateColumns = true;
dataGridView1.DataSource = ds;
dataGridView1.DataMember = "Result";
错在哪里了 我找不出来 --------------------编程问答-------------------- Table[0].Add --------------------编程问答-------------------- 指定表名 --------------------编程问答-------------------- --------------------编程问答-------------------- strcom 什么样 --------------------编程问答-------------------- string strcom = "select Student.StudentID, Name, CourseName,Mark " +
" from Result ,Elective ,CourseInfo,Student" +
"where Elective.ElectiveID= Result.ElectiveID" +
"and Elective.CourseID=CourseInfo.CourseID" +
"and Student.StudentID = Elective.StudentID" +
"and Student.StudentID="+textID;
DataSet ds = new DataSet();
// ds.Tables.Add("Result");
SqlDataAdapter da = new SqlDataAdapter(strcom, conn);
da.Fill(ds);
dataGridView1.AutoGenerateColumns = true;
dataGridView1.DataSource = ds;
dataGridView1.DataMember = ds.Tables[0].DefaultView;
--------------------编程问答-------------------- 下面的两行代码 我发错了
补充:.NET技术 , C#