Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
ALTER proc [dbo].[sp_AmbalajGuncelle]
@ID int,
@adTR nvarchar(250),
@adEN nvarchar(250),
@aktif bit
 
as 
update Ambalajlar 
set Ambalajlar.AmbalajAdiTR = @adTR, Ambalajlar.AmbalajAdiEN = @adEN, Ambalajlar.Aktif = @aktif
where Ambalajlar.ID = @ID
 
I've added the stored procedure in my winform project via function importing. I have also other procedures which have already imported and they are working well. Only the procedure i wrote above does not affect any rows.
 
Here is my imported function provided by entity framework in C# code which also does not throw any exceptions. it seems working well at application side, but doesn't affect any rows at database as i said so.
 
cn.DBConnect.AmbalajGuncelle(Convert.ToInt32(lvAmbalajlar.Tag), txtAmbalajAdiTR.Text, txtAmbalajAdiEN.Text, chkAktif.Checked);
cn.DBConnect.SaveChanges();
 
Thanks for any help.
Posted 30-Nov-11 3:14am
Comments
Mark Nischalke at 30-Nov-11 8:17am
   
Are you sure there are rows to update? Does it work in SQL Server?
umutarge at 30-Nov-11 8:20am
   
Yes, i'm sure and yes again, it works in sql server. I've tried manually with EXEC command in sql server, it worked properly.
Karthik Harve at 30-Nov-11 8:33am
   
Any exceptions are coming..??
umutarge at 30-Nov-11 8:37am
   
no there are no exceptions. actually, this is the annoying part. how can i know what am i supposed to do without an exception?
Laxmikant_Yadav at 30-Nov-11 8:44am
   
Use sql profile to take sql trace. so u will come to know weather our sp get called or not from your application.
umutarge at 30-Nov-11 9:19am
   
I noticed my mistake while tracing, it's kind of parameter issue cause of my mistake. The filter parameter always passes 0. Thank you, all of you.

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

SQLProfiler tool helps to trace/debug SQL query execution. It helps for better trace.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web02 | 2.8.150224.1 | Last Updated 30 Nov 2011
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100