C#中用select查询的结果用dataGridView显示
如果向下面的再建个新表的话da.Fill(ds,"tableName")表名怎么办SqlDataAdapterda=newSqlDataAdapter("selectID...
如果向下面的再建个新表的话 da.Fill(ds,"tableName") 表名怎么办
SqlDataAdapter da = new SqlDataAdapter("select ID as '题号',Contents as '题目',Answer as '答案',Score as '分值',DifficultyName as '难度' "
+ "from Items,Difficulty" + "where items.difficultyid=difficulty.difficultyid into table "tableName"" ,DBConnection.cn);
DataSet ds = new DataSet();
da.Fill(ds,"tableName");
dataGridView1.DataSource = ds.Tables["tableName"];
C#中能不能把select查询的结果用dataGridView直接显示,不用通过再建个新表
还有我上面的那种方法 da.Fill(ds,"tableName") 怎么使用新的表名填充DataSet 展开
SqlDataAdapter da = new SqlDataAdapter("select ID as '题号',Contents as '题目',Answer as '答案',Score as '分值',DifficultyName as '难度' "
+ "from Items,Difficulty" + "where items.difficultyid=difficulty.difficultyid into table "tableName"" ,DBConnection.cn);
DataSet ds = new DataSet();
da.Fill(ds,"tableName");
dataGridView1.DataSource = ds.Tables["tableName"];
C#中能不能把select查询的结果用dataGridView直接显示,不用通过再建个新表
还有我上面的那种方法 da.Fill(ds,"tableName") 怎么使用新的表名填充DataSet 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询