Re: Determining a SQL Server datatype length
From: Joe Monnin (Monnin_at_discussions.microsoft.com)
Date: 02/07/05
- Next message: Michael E. Pouliot: "Re: Message Loops and Application.Run()"
- Previous message: NativeSun: "RE: HttpWebRequest POST not working on my VS2003"
- In reply to: NuTcAsE: "Re: Determining a SQL Server datatype length"
- Messages sorted by: [ date ] [ thread ]
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
>
>
- Next message: Michael E. Pouliot: "Re: Message Loops and Application.Run()"
- Previous message: NativeSun: "RE: HttpWebRequest POST not working on my VS2003"
- In reply to: NuTcAsE: "Re: Determining a SQL Server datatype length"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|