Executing stored procedures as CommandType=Text

From: Elton Wang (anonymous_at_discussions.microsoft.com)
Date: 02/25/05


Date: Fri, 25 Feb 2005 07:51:22 -0800

Hi Gavin,

I don't think it is problem of sql query. It's OK to
execute "exec spName 'parameter1', 'parameter2', ." or
even simply "spName 'parameter1', 'parameter2', ." in
command or dataadapter.

You might need to check the connection ot connection
string.

HTH

Elton Wang
elton_wang@hotmail.com

>-----Original Message-----
>I've got an urgent problem - I'm converting a legacy VB
app to .NET.
>
>I've got thousands of pre-saved strings such as "exec
sp_name 'p1', 'p2',
>'p3'" that execute on a VB 6 application and ADO.
>
>These now need to execute on C# and ADO.NET.
>
>I receive the SQL requests in the string format with all
the parameters
>filled in, so I can't use the strongly typed version of
the SQLCommand
>object's CommandType=StoredProcedure, it's got to be
CommandType=Text.
>
>....
>SqlDataAdapter da = new SQLDataAdapter("exec
sp_name 'p1','p2','p3'", cn );
>da.Fill(ds);
>....
>
>When I try to fill my DataSet I get a SQLException -
 "System Error".
>
>I can see that the stored procedure executes from within
the SQL Profiler.
>
>This worked fine under ADO.
>
>Should I ditch ADO.Net and use an interop to ADO?
>
>Can anyone help on this?
>
>Regards,
>Gavin G. Jones
>
>
>
>.
>



Relevant Pages

  • Re: Syntax
    ... tablename above except that it is an mdb rather than a table in SQL server. ... Thus my connection table is now the mdb file name minus the ".mdb" extension ... the Access mdb connection string should be the variable name as ...
    (microsoft.public.sqlserver.dts)
  • Re: Unable to Locate Server
    ... I am using the copy of SQL Express that came with Visual Studio. ... > Boolean& failoverDemandDone, String host, String failoverPartner, String ... > owningObject, SqlConnectionString connectionOptions, String newPassword, ... >> trying to make a remote database connection while you think your database is ...
    (microsoft.public.sqlserver.setup)
  • Re: Insert date into a datetime column in Visual Basic 2008
    ... Dim cmdString As String ... Dim dte As System.DateTime ... wholly contained within the SQL executed on the server. ... ADO, not ADO.Net, so I can't provide a working example for you). ...
    (microsoft.public.data.ado)
  • Re: Pessimistic locking with approles.
    ... The "fix" is to disable connection pooling in ADO in the connection ... security or SQLS security, and it has nothing whatsoever to do with ... SQL Application Role Errors with OLE DB Resource Pooling ...
    (microsoft.public.sqlserver.security)
  • Re: SQL incorporation with Excel
    ... Excel 2002 VBA by Bullen, Green, Bovey and Rosenberg has a fairly good ... Set a reference to ADO 2.7 in your vb project. ... connection string to find the correct way to connect. ... Our accounting system uses an SQL ...
    (microsoft.public.excel.programming)

Loading