stored procedure does not delete row

Please support our C# advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Sep 2008
Posts: 24
Reputation: matejkralik is an unknown quantity at this point 
Solved Threads: 0
matejkralik matejkralik is offline Offline
Newbie Poster

stored procedure does not delete row

 
0
  #1
Oct 9th, 2008
Hello I use this code as a stored procedure to delete row of the table:

ALTER PROCEDURE dbo.DeleteRowMaterialTyp
    (
    @CisloParam varchar(MAX) /* hodnota v tabulke, ktora nam identifikuje riadok, ktory sa ma zmazat */
    )   
AS
    Delete From MaterialTyp Where Cislo = @CisloParam
    RETURN

And this is code where I call this procedure:
            EtiketyLINQDataContext EtiketyData = new EtiketyLINQDataContext();     
            string CurrentRowCellParam = LINQdataGridView.CurrentRow.Cells[0].Value.ToString();
            EtiketyData.DeleteRowMaterialTyp(CurrentRowCellParam);

It's quite strange to me, because when I execute this DeleteRowMaterialTyp stored procedure, it deletes, also when I use deletion in running application, deletion works again, i can see it on datagridview, but when I come back to the sql environment and manually make selection of the datas, I can see, that nothing has been deleted. Where is the problem? Shall I do something additional between sql database and linq class dbml?
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,735
Reputation: LizR has a spectacular aura about LizR has a spectacular aura about 
Solved Threads: 186
LizR LizR is offline Offline
Posting Virtuoso

Re: stored procedure does not delete row

 
0
  #2
Oct 9th, 2008
2 things come to mind.

1. Is it actually calling the DeleteRowMaterialTyp ? eg, if you changed it to log to a new table like a syslog table to say "I was here with param: xxx" . does it do it?
2. is the value of CurrentRowCellparam what you think it is?
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 24
Reputation: matejkralik is an unknown quantity at this point 
Solved Threads: 0
matejkralik matejkralik is offline Offline
Newbie Poster

Re: stored procedure does not delete row

 
0
  #3
Oct 9th, 2008
aha, ok, I think that problem maybe more, that it cannot touch MaterialTyp table...hmm, but anyway, this touches the storedprocedure DeleteRowMaterialTable, which is called with this line:

EtiketyLINQDataContext EtiketyData = new EtiketyLINQDataContext();
so where is the solution?

because I already used messagebox to see currentrow.cell value that I need...
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,735
Reputation: LizR has a spectacular aura about LizR has a spectacular aura about 
Solved Threads: 186
LizR LizR is offline Offline
Posting Virtuoso

Re: stored procedure does not delete row

 
0
  #4
Oct 9th, 2008
As I suggested, make a new table and adjust the stored procedure to append to a form of log file to say "Hi I was here" so you know it at least called it and that it received the parameter etc.
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 24
Reputation: matejkralik is an unknown quantity at this point 
Solved Threads: 0
matejkralik matejkralik is offline Offline
Newbie Poster

Re: stored procedure does not delete row

 
0
  #5
Oct 10th, 2008
Could please describe me step by step what to do with this log file?
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 1,735
Reputation: LizR has a spectacular aura about LizR has a spectacular aura about 
Solved Threads: 186
LizR LizR is offline Offline
Posting Virtuoso

Re: stored procedure does not delete row

 
0
  #6
Oct 10th, 2008
um, well the idea is to prove that the call is successfully running so the point is to use an additional table as a debug state to say

I got to this point with this value
I got to that point with this value
I didnt do that
I did this

so you can tell from the table where abouts your code failed.
Did I just hear "You gotta help us, Doc. We've tried nothin' and we're all out of ideas" ? Is this you? Dont let this be you! I will put in as much effort as you seem to.
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 24
Reputation: matejkralik is an unknown quantity at this point 
Solved Threads: 0
matejkralik matejkralik is offline Offline
Newbie Poster

Re: stored procedure does not delete row

 
0
  #7
Oct 10th, 2008
After all I found the solution here :

I do not know how to execute delete, insert, update using datacontext...I really don't know, so I just joined the database...
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C# Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC