Object adding itself ...
-
Hi All, I've created an object that inherits from a type in my datacontext which I am then trying to add using this method:
/// /// Saves the new or updated catalog entry /// public void SaveEntry() { if (\_isNewEntry) { \_context.ListOfSampleCatelogs.InsertOnSubmit(this); \_context.SubmitChanges(); \_context.Dispose(); } else { \_context.SubmitChanges(); \_context.Dispose(); } }
Is this pure insanity on my part or is this actually doable? I've spend most of the evening working on this and haven't made any progress or found anyone on the web doing something similar. I also check for an existing record as I either want to update an existing record or add this as a new one ... hmm ... Thanks in advance ...
Jammer Going where everyone here has gone before! :) My Blog
I'll send you some code next week - we use a variation on this pattern.
Deja View - the feeling that you've seen this post before.
-
I'll send you some code next week - we use a variation on this pattern.
Deja View - the feeling that you've seen this post before.
-
Pete, I really do owe you one already!!! Seeing what you use would be so appreciated chap! Cheers,
Jammer Going where everyone here has gone before! :) My Blog
Send me an email so that I know where to send the zip to. Just click the Email link in the thread, and send me your address so that it's kept private.
Deja View - the feeling that you've seen this post before.
-
Send me an email so that I know where to send the zip to. Just click the Email link in the thread, and send me your address so that it's kept private.
Deja View - the feeling that you've seen this post before.
Can I send you my e-mail too?
Giorgi Dalakishvili #region signature my articles #endregion
-
Can I send you my e-mail too?
Giorgi Dalakishvili #region signature my articles #endregion
Sure, why not - if you're interested in this project then feel free.
Deja View - the feeling that you've seen this post before.
-
Sure, why not - if you're interested in this project then feel free.
Deja View - the feeling that you've seen this post before.
I have emailed you. If you don't mind, please CC to me also. I am interested in the pattern which you said.
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions
-
I have emailed you. If you don't mind, please CC to me also. I am interested in the pattern which you said.
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions
I didn't think it would be as interesting.:) Anyhoo - when your email address comes through, I'll add it to the list.
Deja View - the feeling that you've seen this post before.
-
I didn't think it would be as interesting.:) Anyhoo - when your email address comes through, I'll add it to the list.
Deja View - the feeling that you've seen this post before.
I've just sent it. What about writing about an article?
Giorgi Dalakishvili #region signature my articles #endregion
-
I've just sent it. What about writing about an article?
Giorgi Dalakishvili #region signature my articles #endregion
Giorgi Dalakishvili wrote:
What about writing about an article?
Tell you what - see what you think when you get the code, and then let me know if you think I should.
Deja View - the feeling that you've seen this post before.
-
Giorgi Dalakishvili wrote:
What about writing about an article?
Tell you what - see what you think when you get the code, and then let me know if you think I should.
Deja View - the feeling that you've seen this post before.
Waiting for the code then.
Pete O'Hanlon wrote:
Tell you what - see what you think when you get the code, and then let me know if you think I should.
I suspect it's just several lines of code. Something like a snippet.
Giorgi Dalakishvili #region signature my articles #endregion
-
Waiting for the code then.
Pete O'Hanlon wrote:
Tell you what - see what you think when you get the code, and then let me know if you think I should.
I suspect it's just several lines of code. Something like a snippet.
Giorgi Dalakishvili #region signature my articles #endregion
Giorgi Dalakishvili wrote:
I suspect it's just several lines of code. Something like a snippet.
There are certainly several lines of code in it.;P No - it'll take me a little while to sanitize our company specific bits of code in it. It's a combination of custom DataContext and Business Object layer. It's going to take me a little while to change it over to run with a database like Northwind.
Deja View - the feeling that you've seen this post before.
-
Waiting for the code then.
Pete O'Hanlon wrote:
Tell you what - see what you think when you get the code, and then let me know if you think I should.
I suspect it's just several lines of code. Something like a snippet.
Giorgi Dalakishvili #region signature my articles #endregion
Right, I've got Jammer's, Navaneeth's and your email addresses now. When I'm finished I'll send it on to you.
Deja View - the feeling that you've seen this post before.