﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - WebScheduler - Client side exception after inserting event</title><link>http://www.intersoftsolutions.com/Community/WebScheduler/Client-side-exception-after-inserting-event/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>Client side exception after inserting event</title><link>http://www.intersoftsolutions.com/Community/WebScheduler/Client-side-exception-after-inserting-event/</link><pubDate>Mon, 17 Jun 2013 11:41:58 GMT</pubDate><dc:creator>jamesik@centrum.cz</dc:creator><description>&lt;p&gt;Ok, this is solved. The problem was related to the return value of the custom Insert metod in the EventsTableAdapter.&lt;/p&gt;&lt;p&gt;return (int)command.ExecuteScalar()&lt;/p&gt;
&lt;p&gt;needs to be changed to&lt;/p&gt;
&lt;p&gt;return Convert.ToInt32(command.ExecuteScalar())&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Client side exception after inserting event</title><link>http://www.intersoftsolutions.com/Community/WebScheduler/Client-side-exception-after-inserting-event/</link><pubDate>Mon, 17 Jun 2013 10:50:30 GMT</pubDate><dc:creator>jamesik@centrum.cz</dc:creator><description>Hi,&lt;br /&gt;&lt;br /&gt;after inserting event to DB (MS-SQL) I'm getting the following exception on client side:&lt;br /&gt;"Exception has been thrown by the target of an invocation.","Type":"Event","Id":,"Refresh":false})&lt;br /&gt;
&lt;p&gt;ISRes.axd, line 13 character 618"&lt;/p&gt;
&lt;p&gt;Looks like there is passed null value to the Id key and therefore syntax integrity is broken.&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Data are properly passed to DB (no problem found in server side insert method). &lt;br /&gt;&lt;/p&gt;
&lt;p&gt;After inserting new event to the DB table the progress indicator isn't removed and the mentioned client side exception occurs. Webscheduler is not updated (the new event isn't displayed until manual page refresh).&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;I don't have any problem when updating or deleting existing records.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Attaching the server side Insert method:&lt;/p&gt;
&lt;p&gt;[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]&lt;br /&gt; [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]&lt;br /&gt; [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Insert, true)]&lt;br /&gt; public virtual int Insert(int EventID, string CategoryID, global::System.Nullable&amp;lt;int&amp;gt; ResourceID, global::System.Nullable&amp;lt;int&amp;gt; Mode, string Subject, string Description, string Location, bool AllDayEvent, global::System.Nullable&amp;lt;global::System.DateTime&amp;gt; StartTime, global::System.Nullable&amp;lt;global::System.DateTime&amp;gt; EndTime, global::System.Nullable&amp;lt;int&amp;gt; Reminder)&lt;br /&gt; {&lt;br /&gt; this.Connection.Open();&lt;br /&gt;&lt;br /&gt; try&lt;br /&gt; {&lt;br /&gt; this.Insert(CategoryID, resID, Mode, Subject, Description, Location, AllDayEvent, StartTime, EndTime, Reminder);&lt;br /&gt;&lt;br /&gt; SqlCommand command = new SqlCommand();&lt;br /&gt; command.CommandText = "SELECT @@IDENTITY";&lt;br /&gt; command.Connection = this.Connection;&lt;br /&gt; &lt;br /&gt; return (int)command.ExecuteScalar();&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; finally&lt;br /&gt; {&lt;br /&gt; this.Connection.Close();&lt;br /&gt; }&lt;br /&gt; }&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Do you have any idea what might cause the issue?&lt;/p&gt;
&lt;p&gt;I suspect this is somehow connected to the MSSQL related solution as I don't have these problems when trying to connect to the provided MDB file via OleDB...&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Thank you,&lt;/p&gt;
&lt;p&gt;Jakub&lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>