2012-05-12 72 views
1

我有Visual Studio 2010最終...當我嘗試創建一個DataSet時,它已經從模板中丟失...僅適用於Visual C++ ...但所有其他像C#,VB無處不在我...真的給頭痛...只有在Visual C++中它的缺失...我想創建一個數據集& dataTable將數據發送到報告...但我找不到它..哪裏可以找到--DataSet VC++ 2010 Ultimate ..?模板僅在Visual C++中缺失..?

因此,我google搜索一個提醒做以下

1.) I cleared ProjectTemplatesCache & ItemTemplates Cache.. 

2.) devenv.exe/installvstemplates 

但是沒有用....有我不能發現數據集...模板再次..所以對我來說任何意見? 謝謝...

回答

0

此功能在Visual Studio中的C++的本機項目根本不存在,只爲C++/CLI,甚至對於那些it was disabled since Visual Studio 2008,從微軟的一名代表在那頁的答覆說:

Visual Studio 2008不再支持向Visual C++項目添加新的數據源(數據庫 或webservice)。

作爲C++/CLI的解決方法,您可以創建一個空的C#項目,在其中添加數據集,然後在主項目中添加對其的引用。

+0

嗨,YMS我發現從一個架構通過SLOUTION值編碼來創建數據集...感謝您的幫助... – user1328559

+0

同樣遺憾的延遲迴復...因爲我的系統得到格式化...謝謝 – user1328559

0

下面的代碼是XML模式

<?xml version="1.0" encoding="utf-8"?> 
//DataSet Name - EmpDataSet 
<xs:schema id="EmpDataSet" xmlns="urn:Emp" xmlns:xs="http://www.w3.org/2001/XMLSchema" 
    xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" targetNamespace="urn:Emp" attributeFormDefault="qualified " 
    elementFormDefault="qualified"> 
    <xs:element name ="EmpDataSet" msdata:IsDataSet="true"> 
    <xs:complexType> 
     <xs:choice maxOccurs ="unbounded"> 
     <xs:element name ="EmpTable"> 
      <xs:complexType> 
      <xs:sequence> 

       // Below Code is Column Fields 

       <xs:element name ="sl_no" type ="xs:int" minOccurs ="0" /> 
       <xs:element name ="emp_no" type ="xs:string" minOccurs ="0" /> 
       <xs:element name ="emp_detail" type ="xs:string" minOccurs ="0" /> 

      </xs:sequence> 
      </xs:complexType> 
     </xs:element> 
     </xs:choice> 
    </xs:complexType> 
    </xs:element> 
</xs:schema> 

感謝

+0

哦,我誤解了你的評論。通常,創建類型數據集是爲了反映數據庫結構,所以我認爲你找到了一種從數據庫中以編程方式創建數據集的方法,抱歉誤會。 – yms

相關問題