Current location: Hot Scripts Forums » Programming Languages » Windows .NET Programming » How to extract the dataType for a SQL parameter


How to extract the dataType for a SQL parameter

Reply
  #1 (permalink)  
Old 08-16-11, 09:15 AM
m.timoney's Avatar
m.timoney m.timoney is offline
Newbie Coder
 
Join Date: Jan 2007
Location: Leicester - UK
Posts: 76
Thanks: 1
Thanked 0 Times in 0 Posts
Question How to extract the dataType for a SQL parameter

I have an interesting problem,

a old .Net 1.1 application that takes an XML string then reads it into a database via a stored proc.

i need to update it to .net 3.5, unfortunately there is a feature in .net 1.1 that the app uses that have since been drops

the ability to create a typeless parameter in code.
in 1.1 you could declare a parameter with out setting the type, now it needs to have a type.

so i need to ask the SP for the types of the parameters it takes

and before anyone asks i have to do it dynamically as the data contained in the xml string varies on the schema that encoded it, so depending on which schema encoded the data a different SP needs to be called. the link between Schema and SP is in the DB as are the names of the parameters but not the types.

so is there a ways of creating an SQL command of type stored proc and then getting it to populate its parameters from the DB with out me manually getting them. this would then allow me to scroll through the parameters that already have been set up and just assign them values
__________________
Definition of a Beginner, Someone who doesn't know the rules.

Definition of an Expert, Someone who knows when to ignore the rules.
Reply With Quote
  #2 (permalink)  
Old 08-16-11, 09:34 AM
m.timoney's Avatar
m.timoney m.timoney is offline
Newbie Coder
 
Join Date: Jan 2007
Location: Leicester - UK
Posts: 76
Thanks: 1
Thanked 0 Times in 0 Posts
I tried the prepare command and that doesn't seem to do anything
__________________
Definition of a Beginner, Someone who doesn't know the rules.

Definition of an Expert, Someone who knows when to ignore the rules.

Last edited by m.timoney; 08-16-11 at 09:46 AM.
Reply With Quote
  #3 (permalink)  
Old 08-16-11, 10:45 AM
m.timoney's Avatar
m.timoney m.timoney is offline
Newbie Coder
 
Join Date: Jan 2007
Location: Leicester - UK
Posts: 76
Thanks: 1
Thanked 0 Times in 0 Posts
AH HA, SqlCommandBuilder.DeriveParameters()
__________________
Definition of a Beginner, Someone who doesn't know the rules.

Definition of an Expert, Someone who knows when to ignore the rules.
Reply With Quote
Reply

Bookmarks

Tags
.net, dot net, sql


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Export Data from Database to Excel via SQL Command and Customize Style of it For VB.NET without Auto tomason Windows .NET Programming 2 08-10-11 03:11 AM
SQL 2005 Decimal Parameter Type tim8w Visual Basic 0 10-13-08 05:46 PM
Help with ASP & FORMS blessedrub ASP 0 01-23-04 10:22 AM
ASP Calendar..HELP...pls jimthepict ASP 1 07-31-03 05:01 PM
change my field in this example sal21 ASP 3 07-14-03 02:49 AM


All times are GMT -5. The time now is 02:20 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.