Results 1 to 2 of 2

Thread: User CYTPE to convert value to SqlDdType

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2002
    Posts
    66

    User CYTPE to convert value to SqlDdType

    I am working on a class that should reduce my coding by dynamically creating and executing the command objects.

    all my commands are sql stored procedures. I have a datareader that selects the parameters, datatype, and length of the value. I am trying to use these values to create the parameter objects. I am erroring out when I attempt to convert the name of the data type (varchar, datetime, bit, int) to the sqldbytype.

    Is there a way I can convert the name of the value to the actual datatype?

    One Idea I has was to create a function that would be a case statement, depending on the string value the datatype would be returned, but that seems clunky.

    Any Ideas?
    Jason Meckley
    Database Analyst
    WITF

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Huh? What is it specifically that you are trying to do? The name and value are the only 'required' arguments the parameter object needs. I wouldn't worry about the length and type.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width