Re: ODBC.NET

Tech-Archive recommends: Fix windows errors by optimizing your registry



Hi;

Ok, I have it but with 2 things I would like to get better. First, to get
tables or views you can do:

using (OdbcConnection sc = new OdbcConnection(connStr))
{
sc.Open();
DataTable schemaTable = sc.GetSchema("tables"); // or views

for (int ind = 0; ind < schemaTable.Rows.Count; ind++)
if (((string)(schemaTable.Rows[ind])["TABLE_TYPE"]).ToUpper() == "TABLE")
System.Console.WriteLine(" " +
(string)(schemaTable.Rows[ind])["TABLE_NAME"]);
}

I tried using restrictions to get just non-system tables but everything I
tried gave me back no tables.

For stored procedures you can do:
using (OdbcConnection sc = new OdbcConnection(connStr))
{
sc.Open();
DataTable schemaTable = sc.GetSchema("procedures");

for (int ind = 0; ind < schemaTable.Rows.Count; ind++)
System.Console.WriteLine(" " +
(string)(schemaTable.Rows[ind])["PROCEDURE_NAME"]);
}

And for these I have found no way to get just user-defined ones. The
returned data has the same type for all of them.


Any ideas?

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm




"Kevin Yu [MSFT]" wrote:

Hi Dave,

The ODBC.NET itself support getting the schema information by using
OdbcConnection.GetSchema method. It can meet all the requirements here.
However, whether a database supports this depends on the database itself
and the driver that vendor has provided. In this case, we cannot say for
sure that we can do or cannot this. It is out of the scope that our app can
reach.

If anything is unclear, please feel free to let me know.

Kevin Yu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)


.



Relevant Pages

  • Re: winword.exe.manifest for multiple add-ins?
    ... Microsoft Online Community Support ... Get notification to my posts through email? ... where an initial response from the community or a Microsoft Support ... project analysis and dump analysis issues. ...
    (microsoft.public.office.developer.com.add_ins)
  • RE: WMP ActiveX control kills Internet Explorer
    ... utilizes the WMP ActiveX control to play a WMV file. ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ... project analysis and dump analysis issues. ...
    (microsoft.public.win32.programmer.mmedia)
  • RE: Missing method in TLB
    ... missing entries are simply blank vtable entries, but there is no way to ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ... project analysis and dump analysis issues. ...
    (microsoft.public.win32.programmer.ole)
  • Re: Problems with uiAccess = true
    ... It seems that the "A referral was returned from the server" error dialog is ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ... project analysis and dump analysis issues. ...
    (microsoft.public.win32.programmer.ui)
  • RE: Cannot see modules window when debugging
    ... find any known records regarding "Modules" window disappear filed. ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ... project analysis and dump analysis issues. ...
    (microsoft.public.vsnet.debugging)