Re: C# and SQL-Server Stored Procedures

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi Jacek,

Run Sql Profiler and see if the procedure is being called at all. Sql Profile
can be launched from Enterprise Manager (Sql Server 2000) or Sql Server
Management Studio (Sql Server 2005), both from the Tools menu, IIRC.

--
Dave Sexton

"J. S. EDV" <JSEDV@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:86F46D87-920C-4FCA-AFB5-FE12CF1CB15E@xxxxxxxxxxxxxxxx
Hello,

I have got a little problem with stored procedures and C#.

I have got a stored procedure which should only insert something in a table.
For example:

ALTER PROCEDURE DBO.PROC1
AS
insert into dbo.Test values ('test')

when I execute this procedure in my Visual Studio Envirment with right click
on it. It makes what it should The procedure inserts a row in my table.
But if I trie to execute it from C#, it doesn't.

SqlCommand cmd = new SqlCommand("proc1",conn);
cmd.ExecuteNonQuery();

I get the message that 1 row has been affekted - but there is no entry in
the table.

Does anyone has some ideas what I have done wrong?

Thanks!

Jacek


.



Relevant Pages

  • Re: processadmin cannot kill
    ... It is not required to stop and start sql server after giving a role. ... Execute sp_who to identify the process id and execute KILL to kill a ... Once you are ok with this, try killing the process from Enterprise manager ... > problems with a user not being able to kill processes. ...
    (microsoft.public.sqlserver.security)
  • SP execution
    ... I have a stored procedure with parameters in SQL Server 2000 database. ... I execute it in Enterprise Manager, it takes less than 1 second to return ...
    (microsoft.public.vb.general.discussion)
  • Re: dbo qualified name error w Access 2003
    ... correctly, things ended up being owned by dbo, which is *not* ... One tool you should use is SQL Profiler. ... to see the calls between Access and SQL Server, ... >When I use an adp from Access 2000, this code executes successfully for all ...
    (microsoft.public.sqlserver.msde)
  • Re: Locking ASP.NET Session State with SQL Server
    ... SQL Server session state is retrieving and saving varbinary/image ... Go watch it work with SQL Profiler turned on. ... It seems that the sql server solutions is not very scalable or reliable. ... > because all pooled connections were in use and max pool size was> reached. ...
    (microsoft.public.dotnet.framework.performance)
  • RE: Application error event every minute on MSSQLSERVER : "Failure Audit: Login failed for user NT A
    ... Server is 2000, you can open Enterprise Manager, expand your SQL Server ... Also since "NT AUTHORITY\SYSTEM" is a service account, ... you can run SQL Profiler to monitor your SQL Server instance and add ... Microsoft Online Community Support ...
    (microsoft.public.sqlserver.security)