???? ID: 309681 - ????? ???????: 04 ?????? 2010 - ??????: 2.0 ?????? ??????? ?? GetOleDbSchemaTable ?? ????? C# .NET ?? ????? ???? ??????? ???? ????
?? ????? ????????????????? ???? ?? ?? ???? ?? ?? ????? ???? ????GetOleDbSchemaTable?? ??? ????OleDbConnection???????? ADO.NET ??????? ?????? ??????? ??????? ???? ?? ???? ?????? ??????? ??? ??? ???? ????? ??????? ?? ?????? ???? ?????, ???????? ?? ????? ??? ???? ??????? ?? ?????? ???, ??? ?? ?????? ?? ????? ?? ????? ????? ???? ???????? ?????, ????? ?? autonumber ????? ??? ??? ?????? ?????? ??????? ????? ???? ????? ??? ?? ??? ???? ?? ?????? ??GetOleDbSchemaTable?? ?? ?? ????? ????SqlClient.SqlConnection???????? ??? SQL ????? .NET ???? ??????? exposes backend ?????? ??????? ???????? ???????????? ?? ??????? ??????? ?? ?????? ?? ??? ????? ?? ?????? Microsoft SQL Server ?????? ???????? ???????????? ?? ???? ??? ???? ??????? ?? ??? MSDN ????????? ??? Transact SQL ?????? ?????? ??????????????? ???? outlines ???????? ?????????, ??????????, ??????? ??????, ?? ???? ???? ???:
OleDbConnection ???????? ?? GetOleDbSchemaTable ????OLE DB .NET ???? ??????? ?? ????? ???? ??GetOleDbSchemaTable?? ??? ????OleDbConnection?????? ??????? ?? ??????? ???? ?? ??? ???????? ???GetOleDbSchemaTable???? ?? ??DataTable?? ?????? ??????? ?? ????????? ??????? ????GetOleDbSchemaTable?????? ???????? ?? ??OleDbSchemaGuidargument that identifies which schema information to return (such as tables, columns, and primary keys). The second argument is an Object array of restrictions to filter the rows that are returned in the schemaDataTable(for example, you may specify restrictions for table name, type, owner, and /or schema). OleDbSchemaGuid MembersTheOleDbSchemaGuidargument specifies the type of schema table for theGetOleDbSchemaTable?????? ??? Some of theOleDbSchemaGuidmembers include the following:
????????Restrictions are an Object array of filter values, each of which corresponds to aDataColumnin the resultingDataTable. TheOleDbSchemaGuidargument determines the relevant restrictions. For example, when you specify anOleDbSchemaGuidof tables, the array of restrictions is as follows:{TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE} To review the available restrictions, click any of theOleDbSchemaGuidmembers at the following Microsoft Web site:OleDbSchemaGuid Members When you pass values in the restriction array, include the Visual
C# .NETNULLkeyword for array elements that do not contain values. For
example, if you want to retrieve table schemas, useOleDbSchemaGuid.Tables. However, if you specify tables, this also returns aliases,
synonyms, views, and other related objects. Thus, if you want to filter out all
objects except tables, use a restriction of TABLE for TABLE_TYPE. ?? ????? ?? ???? ???NULLfor TABLE_CATALOG, TABLE_SCHEMA, and TABLE_NAME because you are
not filtering on these objects:http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdataoledboledbschemaguidmemberstopic.asp (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdataoledboledbschemaguidmemberstopic.asp) Returned DataTableTheDataTablethat theGetOleDbSchemaTablemethod returns has a row for each object that meets theOleDbSchemaGuidtype and the restriction criteria. TheDataTablehas a column for each of the restriction columns, which is followed by additional schema information based on theOleDbSchemaGuid????? ????????? ?? ???, ?? ?? ????? ??? ?? ?????, ???????? ?????? ??? ??DataTable??? ??????? ?????? ??: ????? ?? ??? (??????, ????? ??????????, ???? TABLE_CATALOG, TABLE_SCHEMA ?? TABLE_NAME) ?? ?? ???? ?? ??????? ???? ?? ??? ?? ??????? ?? ??????? ?????? ?? ????? ?? ????? ?? ???????????? zero-based ??: ???? ??????? ??? ????? ?? ???? ???????? ?????????? ????? ??????? ???????? ??? SQL Server ????????? ????????OleDbSchemaGuid.Tables?? ???????? (????? ????) ??? ?? ??? ?? ???? ?? ??? ????? ????? ??? ?? ???? ??? ??? ?? ????????? {??, ??, ??, "??????"} ?? ??? ???????? ???? ??, ?? ?? ???? ???? TABLE_TYPE ?? ?????? ???????? ???? ?? ??? ??????? ?? ?? ?????? ???? (TABLE_NAME) ?? ??? ?????? ?????? ??? ???????? ?????? ?? ????
????? ?? ???? ?????? ?? ??? ?????? ?? Retrieves ?????????? ????? ?? ??????????? ?? ??? ?????? ??????? ???????? ?????? SQL Server ????????? ??????? ????OleDbSchemaGuid.Tables?? ???????? (????? ????) ??? ?? ??? ?? ???? ?? ??? ????? ????? ??? ?? ???? ??? ??? ???? ?????? ????????? ???????? ???? ?? {??, ??, "???????????", "??????"}, ???? ?? ?????? ??????????? ?? ??? ????? ???? ?? ??? ??????? ?? ???? ?? ??? ?????? ?????? ?? ??? ?????? ??????? ???
???? ?????? ??? ????? ?? ??????? ?? ????? ?????????? ????? ??????? ??? SQL Server ????????? ??????? ?????? ??????????? ??? ????? ?? ????OleDbSchemaGuid.Columns?? ??????? ?? ???????? ?? ??? ?? ??? ?? ???? ?? ??? ????? ????? ????? ??? ???? ??? ??? ?? ????????? {??, ??, "???????????", ??} ?? ??? ???????? ???? ??, ??????????? ?? ?????? ?? ??? ???? ????? ???????? ???? ?? ??? ?????? ???
???? ?????? ??? ???????? ???????? ??????? ?? ????? ???????????????? ?? ???????? ????? ?????? SQL Server ????????? ??? ????? ????? ??????? ??????? ?? ???? ?? ?????? SQL Server Pubs ??????? ??? ???OleDbSchemaGuid.Primary_Keys??? ?????? ?? ??? ?? ??? ?? ???? ?? ??? ????? ????? ??? ?? ?? ???????? ????? ???? ??? ?? ????? ???OleDbConnectionSQL ????? ?? ???? ??????? SQL Server ??????? ?? ??? ???? ?? ????: ????????? ??????? ??? ??????????? ?? ?????? ?? ???????? ????? ?? ??????? ???? ?? ??? ?? {"?????????", "dbo", "???????????"} ?? ??? ???????? ???? ?? ????? ????:
???????? ???? ???? ?? ???OleDbSchemaGuid??????? ?? ???, Microsoft .NET ??? ????? ???? ????? Framework ?????????? ????????? ??? (SDK) ?? ???????? ?????? ?????? ?????????? ?? ?? ???? ?? ??? ???? ?? ????? ????OleDbSchemaGuid?????: OleDbSchemaGuid ????? ???? ??????? ?? ???, ?? ??????? .NET ??? ????? ???? Framework SDK ????????:HTTP://MSDN.Microsoft.com/en-us/library/SYSTEM.DATA.OLEDB.oledbschemaguid_members.aspx (http://msdn.microsoft.com/en-us/library/system.data.oledb.oledbschemaguid_members.aspx) ?????? ??????? ?? ??????? ?? ??????? ?? ??? ?? HTTP://MSDN.Microsoft.com/en-us/library/kcax58fh.aspx (http://msdn.microsoft.com/en-us/library/kcax58fh.aspx) OleDbConnection.GetOleDbSchemaTable ???? HTTP://MSDN.Microsoft.com/en-us/library/SYSTEM.DATA.OLEDB.oledbconnection.getoledbschematable.aspx (http://msdn.microsoft.com/en-us/library/system.data.oledb.oledbconnection.getoledbschematable.aspx) OleDbSchemaGuid.Tables ????? HTTP://MSDN.Microsoft.com/en-us/library/SYSTEM.DATA.OLEDB.oledbschemaguid.tables.aspx (http://msdn.microsoft.com/en-us/library/system.data.oledb.oledbschemaguid.tables.aspx) OleDbSchemaGuid.Columns ????? HTTP://MSDN.Microsoft.com/en-us/library/SYSTEM.DATA.OLEDB.oledbschemaguid.columns.aspx (http://msdn.microsoft.com/en-us/library/system.data.oledb.oledbschemaguid.columns.aspx) OleDbSchemaGuid.Primary_Keys ????? HTTP://MSDN.Microsoft.com/en-us/library/SYSTEM.DATA.OLEDB.oledbschemaguid.primary_keys.aspx (http://msdn.microsoft.com/en-us/library/system.data.oledb.oledbschemaguid.primary_keys.aspx) ???? ???? ???? ??:
???? ?????? ??????????????????: ?? ???? ?? ???? ??????? ?? ????? ?? Microsoft ????-?????? ?????????? ?????? ?????? ???? ??? ??. Microsoft ???? ??? ????-???????? ?? ????-???????? ????? ?????? ?? ???? ???????? ???? ?? ???? ????? ????? ??? ?? ??? ?????? ?? ???? ???? ???? ??? ????? ??. ???????, ????-???????? ???? ????? ???? ???? ???? ???. ?????, ????????, ?????-???? ?? ??????? ?? ???????? ?? ???? ???, ???? ?? ??? ?????? ???? ???? ??? ????? ??? ?? ???? ??. Microsoft ??????? ??? ???? ?? ?????? ?? ??????????, ????????? ?? ??? ?????? ?? ???? ????? ?? ???? ???????? ?? ??? ???? ????? ?? ??? ????????? ???? ??. Microsoft ????-?????? ?????????? ?? ????? ?????? ?? ?? ??? ??. ?????????? ?? ??????? ????????? ??????? ??:309681
(http://support.microsoft.com/kb/309681/en-us/
)
| ???? ?????? ???? ?????? ??????
????????? ?????? ??????? ???????? ??????
|






Windows Live
Facebook
Twitter
Linkedin
Digg it
Yahoo
Delicious
StumbleUpon
Yammer
Reddit
Technorati
FriendFeed
Email

????? ?? ???? ????
