A
Aleksey Dmitriyev
How can I describe parameters in my SQL statement before Executing it?
For example, there a statement "select * from emp where ename = @ename". I
need to find out what type, size, and etc. of @ename parameters I need to
provide. I believe SqlCommand.Prepare will fail if I don't supply a
parameter for @name. Bu what if I don't know it?
I am looking for something similar to SQLDescribeParam() in ODBC or
ICommandWithParameters::GetParameterInfo() in OLEDB.
I cannot find anything like that in ADO.NET/SqlClient. My current ideas
include using SET FMTONLY ON, or invoking sp_prepare, but I don't see a
simple way to do that. Does anyone have an idea?
--Aleksey
For example, there a statement "select * from emp where ename = @ename". I
need to find out what type, size, and etc. of @ename parameters I need to
provide. I believe SqlCommand.Prepare will fail if I don't supply a
parameter for @name. Bu what if I don't know it?
I am looking for something similar to SQLDescribeParam() in ODBC or
ICommandWithParameters::GetParameterInfo() in OLEDB.
I cannot find anything like that in ADO.NET/SqlClient. My current ideas
include using SET FMTONLY ON, or invoking sp_prepare, but I don't see a
simple way to do that. Does anyone have an idea?
--Aleksey