[英]Retrieving values from SQL Server
My table in SQL Server has 3 fields 我在SQL Server中的表有3个字段
serial no. (int)
days (varchar)
status (bit)
With the help of a dictionary how can I retrieve days and status as a key-value pair from SQL Server using a SqlDataReader
? 借助字典,如何使用
SqlDataReader
从SQL Server中检索天和状态作为键值对?
This seems very much like homework, so here's some pseudocode to help you towards the answer: 这似乎很像家庭作业,因此这里有一些伪代码可以帮助您找到答案:
I've put a large number of links to pages on msdn.microsoft.com into the steps I've detailed. 我已将许多指向msdn.microsoft.com上页面的链接放入我已详细介绍的步骤中。 By reading through those, and looking at the code samples that are present on each page, you should be able to put together some working code =)
通过阅读这些内容,并查看每一页上的代码示例,您应该能够将一些有效的代码放在一起=)
Dictionary<int, Dictinary<string,bool> dict=new Dictionary<int, Dictinary<string,bool>;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.