本文介绍了我做错了什么(SQLServerCE中的Getschema方法)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我对SQLServerCe命名空间中的Getschema方法有疑问 - 我在C#中相当新,所以我可能忽略了一些东西。 I have a problem with the Getschema method in the SQLServerCe namespace - I am fairly new in C# so I may have overlooked something. 我的问题是我只有C#Express版本(我没有移动项目)所以我被"强迫"了为我的SQL Compact数据库(.sdf)创建自己的查看器,因为我无法使用SQL Server Management Studio Express来存储这些文件。但是,当我在相应的命名空间中使用Getschema()方法时,它似乎不起作用。My problem is that I have only the C# Express edition (I don't have the mobile projects) so I am "forced" to make my own viewer for my SQL Compact databases (.sdf) as I can't use SQL server Management Studio Express for these files. However, when I use the Getschema() method in the corresponding namespace it seems to not work.这是我使用的代码: string connstring = @"数据源= c:\!studiec#\betatest.sdf" ; string connstring = @"Data Source=c:\!studiec#\betatest.sdf"; SqlCeConnection myconn = new SqlCeConnection (@ connstring); SqlCeConnection myconn = new SqlCeConnection(@connstring); myconn.Open(); myconn.Open(); DataTable mytable = myconn.GetSchema (); DataTable mytable = myconn.GetSchema(); 我收到错误"不支持指定方法" - 但我找不到错误。根据MSDN数据库,SQLServerCE命名空间支持(重载)的Getschema方法,智能感知也会感知它。尝试以下语法给了我相同的错误消息:I get the error "Specified method is not supported" -but I can't find the errors. According to the MSDN database the (overloaded) Getschema method is supported within the SQLServerCE namespace , also intellisense senses it. Trying the following syntax gave the me same error message: string connstring = @" Data Source = c:\!studiec#\betatest.sdf" ; string connstring = @"Data Source=c:\!studiec#\betatest.sdf"; SqlCeConnection myconn = new SqlCeConnection (@ connstring); SqlCeConnection myconn = new SqlCeConnection(@connstring); myconn.Open(); myconn.Open(); DataTable mytable = myconn.GetSchema(" Tables"); DataTable mytable = myconn.GetSchema("Tables"); 有人可以帮助我并指出我做错的地方吗?提前致谢。Someone can help me and point me where I did wrong? Thanks in advance. Bipolar Penguin Bipolar Penguin 推荐答案 确保你使用.net framework 2.0和C#express 2005.GetSchema wasn' t支持1.1 Make sure you're using .net framework 2.0 and C# express 2005. GetSchema wasn't supported in 1.1 这篇关于我做错了什么(SQLServerCE中的Getschema方法)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 09-26 21:46