﻿<?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 - How to AutoIncrement ID if adding new Row in WebGrid</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-to-AutoIncrement-ID-if-adding-new-Row-in-WebGrid/</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>How to AutoIncrement ID if adding new Row in WebGrid</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-to-AutoIncrement-ID-if-adding-new-Row-in-WebGrid/</link><pubDate>Thu, 18 Oct 2012 23:07:31 GMT</pubDate><dc:creator>Hans</dc:creator><category>Webgrid7</category><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I made a simple WebGrid sample based on your information.&lt;br&gt;&lt;/br&gt;I bind WebGrid to access data source (Northwind.mdb database and Shippers table).&lt;br&gt;&lt;/br&gt;On ShipperID column, I set Visible property to False and IsAutoIncrement  property to True.&lt;br&gt;&lt;/br&gt;And I can reproduce your issue as well.&lt;/p&gt;
&lt;p&gt;To resolve this issue please try to modify InsertCommand and InserParameters of you DataSource control.&lt;br&gt;&lt;/br&gt;In my sample, I modify InsertCommand from:&lt;/p&gt;&lt;pre&gt;InsertCommand="INSERT INTO [Shippers] ([ShipperID], [CompanyName], [Phone]) VALUES (?, ?, ?)"
&lt;/pre&gt;
&lt;p&gt;To:&lt;/p&gt;&lt;pre&gt;InsertCommand="INSERT INTO [Shippers] ([CompanyName], [Phone]) VALUES (?, ?)"&lt;/pre&gt;
&lt;p&gt;I also modify InsertParameters from:&lt;/p&gt;&lt;pre&gt;&amp;lt;InsertParameters&amp;gt;
	&amp;lt;asp:Parameter Name="ShipperID" Type="Int32" /&amp;gt;
        &amp;lt;asp:Parameter Name="CompanyName" Type="String" /&amp;gt;
        &amp;lt;asp:Parameter Name="Phone" Type="String" /&amp;gt;
&amp;lt;/InsertParameters&amp;gt;&lt;/pre&gt;
&lt;p&gt;To:&lt;/p&gt;&lt;pre&gt;&amp;lt;InsertParameters&amp;gt;
	&amp;lt;asp:Parameter Name="CompanyName" Type="String" /&amp;gt;
        &amp;lt;asp:Parameter Name="Phone" Type="String" /&amp;gt;
&amp;lt;/InsertParameters&amp;gt;&lt;/pre&gt;
&lt;p&gt;If the issue still persists, could you modify my sample so that I replicate your issue on my sample?&lt;br&gt;&lt;/br&gt;So I can help you to investigate the issue further more.&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br&gt;&lt;/br&gt;Hans.&lt;/p&gt;</description></item><item><title>How to AutoIncrement ID if adding new Row in WebGrid</title><link>http://www.intersoftsolutions.com/Community/WebGrid/How-to-AutoIncrement-ID-if-adding-new-Row-in-WebGrid/</link><pubDate>Thu, 18 Oct 2012 03:23:22 GMT</pubDate><dc:creator>sobikash11@googlemail.com</dc:creator><category>Webgrid7</category><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;i have created a Webgrid with three Columns:&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;ID   Place   Name&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;I setted the ID Column to visible = "false",  IsAutoincrement = "true". Iam working with a Oracle Database. In the Database i added Trigger for the Autoincrement of the ID.&lt;/p&gt;
&lt;p&gt;My Problem is that if i try to add a Row in the WebGrid i getting a Error: &lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;"ID" column does not allow nulls&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;but if i add a Row directly in the Database it works.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Why does the WebGrid do not an AutoIncrement?&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>