﻿<?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 - WebGrid Enterprise - WebGrid with GUID</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid-with-GUID/</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>WebGrid with GUID</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid-with-GUID/</link><pubDate>Wed, 02 Sep 2009 08:07:46 GMT</pubDate><dc:creator>james</dc:creator><category>ISDataSource</category><category>GUID</category><description>&lt;p&gt;George, in normal GUID case, the Grid should be able to insert the row successfully without additional code. However, your case is a bit different since the GUID is assigned in the backend, and not from front/middle layer.&lt;/p&gt;&lt;p&gt;Fortunately, WebGrid has a solution for your scenario which is very similar to the solutions in the KB article that Gordon provided. In short, you need to pass the GUID from backend into datasource level which involves two phases:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;Define an InputOutput parameter in the InsertParameters of your ISDataSourceTable definition.&lt;br /&gt;Example:&lt;br /&gt;&lt;pre&gt;&amp;lt;InsertParameters&amp;gt;
            &amp;lt;asp:Parameter Direction="InputOutput" Name="BusinessID" Type="Object" /&amp;gt;&lt;br /&gt;            ...&lt;span style="font-family: 'lucida sans unicode'; font-size: 13px; white-space: normal; "&gt; &lt;/span&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Customize/extend your DoInsert method which retrieve the GUID that assigned in the backend, and pass it back to the InputOutput parameter.&amp;nbsp;&lt;br /&gt;Example:&lt;br /&gt;&lt;pre&gt;DataObjectMethodAttribute(DataObjectMethodType.Insert, true)]
public int DoInsert(ref System.Guid BusinessID, ...)
{
    // your insert call to SP
    objecet returnValue = DAL.InvokeYourInsertSP(params);
    // assign the returnValue, which should be the GUID value from your SP call
    BusinessID = returnValue;
}&lt;/pre&gt;&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;The above code assumes that your SP should return the GUID value properly, as in the case of Northwind sample where it returns the identity of the OrderId.&lt;/p&gt;
&lt;p&gt;When an InputOutput parameter (ref) is assigned back from DoInsert method, WebGrid automatically detects the new value and assign it to the datasource and UI. &lt;/p&gt;
&lt;p&gt;Hope this helps,&lt;br /&gt;James.&lt;/p&gt;</description></item><item><title>WebGrid with GUID</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid-with-GUID/</link><pubDate>Tue, 01 Sep 2009 22:54:39 GMT</pubDate><dc:creator>gkfahnbulleh@lakepiso.com</dc:creator><category>ISDataSource</category><category>GUID</category><description>&lt;p&gt;Gordon, the insert stored proc, does not require the id.  The ID is passed internally. Here it is:&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;[dbo].[sp_Business_Insert]&lt;br /&gt;(&lt;br /&gt; &lt;br /&gt; @BusinessName nvarchar(100),&lt;br /&gt; @Address1 nvarchar(100),&lt;br /&gt; @Address2 nvarchar(50),&lt;br /&gt; @City nvarchar(50),&lt;br /&gt; @State nvarchar(20),&lt;br /&gt; @PostalCode nvarchar(20),&lt;br /&gt; @Country nvarchar(30),&lt;br /&gt; @ProfessionalID1 nvarchar(50),&lt;br /&gt; @ProfessionalID2 nvarchar(50),&lt;br /&gt; @ProfessionalID3 nvarchar(50),&lt;br /&gt; @StatusID tinyint,&lt;br /&gt; @AdminFirstName nvarchar(20),&lt;br /&gt; @AdminLastName nvarchar(20),&lt;br /&gt; @AdminPhone nvarchar(20),&lt;br /&gt; @AdminPhoneExt nvarchar(10),&lt;br /&gt; @AdminEmail nvarchar(50),&lt;br /&gt; @GName nvarchar(20)&lt;br /&gt;)&lt;br /&gt;AS&lt;br /&gt;&lt;span size=" 0"&gt;&lt;span style="background-color: #ffc000"&gt;DECLARE @BusinessID uniqueidentifier&lt;br /&gt;SET @BusinessID=NEWID()&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;
&lt;p&gt; SET NOCOUNT OFF;&lt;br /&gt;INSERT INTO [dbo].[Business] ([BusinessID], [BusinessName], [Address1], [Address2], [City], [State], [PostalCode], [Country], [ProfessionalID1], [ProfessionalID2], [ProfessionalID3], [StatusID], [AdminFirstName], [AdminLastName], [AdminPhone], [AdminPhoneExt], [AdminEmail], [GName]) VALUES &lt;br /&gt;(@BusinessID, @BusinessName, @Address1, @Address2, @City, @State, @PostalCode, @Country, @ProfessionalID1, @ProfessionalID2, @ProfessionalID3, @StatusID, @AdminFirstName, @AdminLastName, @AdminPhone, @AdminPhoneExt, @AdminEmail, @GName);&lt;br /&gt; &lt;br /&gt;SELECT BusinessID, BusinessName, Address1, Address2, City, State, PostalCode, Country, ProfessionalID1, ProfessionalID2, ProfessionalID3, StatusID, AdminFirstName, AdminLastName, AdminPhone, AdminPhoneExt, AdminEmail, GName FROM ArcBusiness WHERE (BusinessID = @BusinessID)&lt;/p&gt;</description></item><item><title>WebGrid with GUID</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid-with-GUID/</link><pubDate>Tue, 01 Sep 2009 22:42:32 GMT</pubDate><dc:creator>gordont</dc:creator><category>ISDataSource</category><category>GUID</category><description>&lt;p&gt;Hi George,&lt;/p&gt;
&lt;p&gt;It's true, I noticed that your issue is in inserting, the issue that you have because that the ID column cannot be null, that's why I point to the knowledge base, if you check the knowledge base contain step by step to handle the inserting problem if the ID cannot be null. I think it's similliar with your issue.&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
&lt;p&gt;Gordon Tumewu&lt;/p&gt;</description></item><item><title>WebGrid with GUID</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid-with-GUID/</link><pubDate>Tue, 01 Sep 2009 13:30:54 GMT</pubDate><dc:creator>gkfahnbulleh@lakepiso.com</dc:creator><category>ISDataSource</category><category>GUID</category><description>&lt;p&gt;You can find the video &lt;a href="http://www.screencast.com/users/GKFahnbulleh/folders/Jing/media/c1ed8ecd-2e1d-465a-aec6-e2b187b6dc7b" target="_blank"&gt;Here&lt;/a&gt;&lt;/p&gt;</description></item><item><title>WebGrid with GUID</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid-with-GUID/</link><pubDate>Tue, 01 Sep 2009 09:52:24 GMT</pubDate><dc:creator>gkfahnbulleh@lakepiso.com</dc:creator><category>ISDataSource</category><category>GUID</category><description>&lt;p&gt;Gordon,&lt;br /&gt;&lt;br /&gt;My issue is not in retrieving the GUID.  It is in INSERTING the GUID.  I will post a video for you.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;</description></item><item><title>WebGrid with GUID</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid-with-GUID/</link><pubDate>Tue, 01 Sep 2009 06:32:07 GMT</pubDate><dc:creator>gordont</dc:creator><category>ISDataSource</category><category>GUID</category><description>&lt;p&gt;Hi George,&lt;/p&gt;
&lt;p&gt;Actually we have a knowledge base about retrieving identity, probably you can use it also, you can browse it in &lt;a href="http://support.intersoftpt.com/KBArticle.aspx?aid=207"&gt;http://support.intersoftpt.com/KBArticle.aspx?aid=207&lt;/a&gt; or &lt;a href="http://support.intersoftpt.com/KBArticle.aspx?aid=227"&gt;http://support.intersoftpt.com/KBArticle.aspx?aid=227&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Hope this helps.&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
&lt;p&gt;Gordon Tumewu&lt;/p&gt;</description></item><item><title>WebGrid with GUID</title><link>http://www.intersoftsolutions.com/Community/WebGrid/WebGrid-with-GUID/</link><pubDate>Tue, 01 Sep 2009 02:30:05 GMT</pubDate><dc:creator>gkfahnbulleh@lakepiso.com</dc:creator><category>ISDataSource</category><category>GUID</category><description>&lt;p&gt;I have an isDataSource connected to an insert proc with a GUID&lt;/p&gt;
&lt;p&gt;The insert proc does not expect or require the GUID; however, when WebGrid attempts an insert, I get an error saying the field cannot be blank.&lt;br /&gt;&lt;br /&gt;How do I get this to work?&lt;/p&gt;</description></item></channel></rss>