Limit choices that can be provided to a method argument
-
I tried to Google this but I dont really know what I am trying to ask I guess. How can I emulate what the SqlCommandType property does with regard to the 3 choice list? You can only choose Text, Stored Procedure and TableDirect. I have the need to do the same thing.
CleaKO
"Now, a man would have opened both gates, driven through and not bothered to close either gate." - Marc Clifton (The Lounge)
-
I tried to Google this but I dont really know what I am trying to ask I guess. How can I emulate what the SqlCommandType property does with regard to the 3 choice list? You can only choose Text, Stored Procedure and TableDirect. I have the need to do the same thing.
CleaKO
"Now, a man would have opened both gates, driven through and not bothered to close either gate." - Marc Clifton (The Lounge)
Can you give some code? My first thought was you might use an Enum in some way, but it is hard to know without knowing what you want your method to do...
-
I tried to Google this but I dont really know what I am trying to ask I guess. How can I emulate what the SqlCommandType property does with regard to the 3 choice list? You can only choose Text, Stored Procedure and TableDirect. I have the need to do the same thing.
CleaKO
"Now, a man would have opened both gates, driven through and not bothered to close either gate." - Marc Clifton (The Lounge)
I think this is what you are asking for. System.Data.CommandType will give you the enum list for text, sp, table, etc. IE: Public Sub ExecuteSQLScalar(ByVal vCommandType As CommandType = CommandType.Text, more parms here...) Found the online MSDN page if you need a little more detail: http://msdn.microsoft.com/en-us/library/system.data.commandtype(VS.80).aspx[]