Yeonwoon

hi.

i'm currently using ADO.NET through c++/cli (managed c++),

and i'm using asynchronous method that starts with BeginExecute..., EndExecute...

here's some pseoudo-code.

Code Snippet


SqlConnection dbConn("...;async=true");
dbConn.Open();


if (dbConn.State == ConnectionState::Open)
{
SqlCommand command(nullptr, %dbConn);
command.CommandText = "dbo.sp_test_param";
command.CommandType = CommandType::StoredProcedure;

command.Parameters->AddWithValue("@param1", 1);
command.Parameters->AddWithValue("@param2", 2);
command.Parameters->AddWithValue("@param3", 3);

IAsyncResult^ ar = command.BeginExecuteNonQuery();

do
{
System::Threading::Thread::Sleep(1);
} while(ar->IsCompleted);

command.EndExecuteNonQuery(ar);


}

dbConn.Close();

when this code is executing, 'dbo.sp_test_param' procedure may execute with no error.

now, i'm trying to catch text data that transfered through network, to invoke above procedure. by using profiler(sql2005), i was caught text data. that must be just like... this. (see below)

Code Snippet

exec dbo.sp_test_param @param1=1, @param2=2, @param3=3

i want to eliminate @param1=, @param2, @param3=... in text data. i think they are no need to exist at most in my case. or if there are something that return value or output parameter, are they must be named parameter

please, give a little help or article to read about it.

thanks.



Re: .NET Framework Data Access and Storage how can i use unnamed parameter in ADO.NET?

Bill Lin - MSFT

SqlClient requires named parameters. Other providers like ODBC.NET provider might use positional parameters.




Re: .NET Framework Data Access and Storage how can i use unnamed parameter in ADO.NET?

Yeonwoon

thank you for your answer.

i already know about it.

but, i can't use other provider, because they doesn't support asynchronous methods.

it is very important for me.

so now, is there no way to use unnamed parameter

if you know something to read about this like references or articles whether possible or not possible, please let me know.

thanks.





Re: .NET Framework Data Access and Storage how can i use unnamed parameter in ADO.NET?

Bill Lin - MSFT

Sorry, but I'm pretty sue there's no way to use unnamed parameters.

Bill Lin, ADO.NET team

Microsoft






Re: .NET Framework Data Access and Storage how can i use unnamed parameter in ADO.NET?

Yeonwoon

thank you! I really appreciate.