Re: Determining a SQL Server datatype length

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

From: Joe Monnin (Monnin_at_discussions.microsoft.com)
Date: 02/07/05


Date: Mon, 7 Feb 2005 12:23:06 -0800

Apparantly, Microsoft has already thought about this. I just discoverd that
ADO.net 2.0 will support a GetSchema() method found in the connection class
that will provide a .net generic way to get the size of table columns. The
article (http://www.devx.com/dbzone/Article/27131/0/page/1) does not mention
if stored procedure metadata will also be available....Very interesting.

"NuTcAsE" wrote:

> Hey Joe,
>
> Well the approach I suggested is very SQL Server centric. In any case
> which ever database you do use, you will first need to get the schema
> of the stored proc and check out its parameter lengths. Im not sure how
> that is achieved on other databases, but you can abstract the
> functionality of getting the parameter lengths into a seperate project.
>
> It would work something like this:
>
> 1. Main application calls GetParameterLength ("paramName", "sprocName",
> DbConnection connection) :int of lets say a project called DbSchema.dll
> 2. DbSchema project first checks the provider type of the connection
> (currently in 1.1 you can do this by checking its type).
> 3. If the connection is of SqlConnection, then you execute the above
> example and get the parameter lenth. If its say OracleConnection, you
> use an oracle specific query (im sure you can get schema information
> for oracle too). Basically a switch statement to execute the correct
> query.
>
> Apart from that AFIK there is not .net generic way to get the schema
> information of a stored proc. Sorry
>
> NuTcAsE
>
>



Relevant Pages

  • Re: jdbc icc connection cache
    ... using ICC with RAC as well as Fast Connection Failover and Runtime ... (create a type in schema A, ... get around this issue and the QA manager is gun shy with some Oracle ... researching using the 11G jdbc thin driver he came across the doc. ...
    (comp.databases.oracle.server)
  • Re: jdbc icc connection cache
    ... using ICC with RAC as well as Fast Connection Failover and Runtime ... (create a type in schema A, ... get around this issue and the QA manager is gun shy with some Oracle ... researching using the 11G jdbc thin driver he came across the doc. ...
    (comp.databases.oracle.server)
  • RE: ADO.Net Connection Pooling Problem with Oracle
    ... the CLR is releasing the connection to your database. ... the number of database sessions in Oracle seem to ...
    (microsoft.public.dotnet.framework.adonet)
  • RE: SOS! ORA-03114: not connected to ORACLE && MSs Bug??
    ... not connected to ORACLE && MS's Bug?? ... > but sometimes returning the following exception "ORA-03114: ... > when loosing the connection with the Oracle database server the connections ... > even after the connection with the database server has been restore. ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: SOS! ORA-03114: not connected to ORACLE && MSs Bug??
    ... not connected to ORACLE && MS's Bug?? ... > but sometimes returning the following exception "ORA-03114: ... > when loosing the connection with the Oracle database server the connections ... > even after the connection with the database server has been restore. ...
    (microsoft.public.dotnet.framework.adonet)