<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>ASP.NET Dynamic Data</title><link>http://forums.asp.net/1145.aspx</link><description>Discussions regarding the new scaffolding framework in ASP.NET</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Validating on insert</title><link>http://forums.asp.net/thread/3082693.aspx</link><pubDate>Sun, 12 Apr 2009 22:28:02 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3082693</guid><dc:creator>sjnaughton</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3082693.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1145&amp;PostID=3082693</wfw:commentRss><description>&lt;p&gt;Well thats wierd I&amp;#39;ve use &lt;strong&gt;this&lt;/strong&gt; several time &lt;img src="http://forums.asp.net/emoticons/emotion-2.gif" alt="Big Smile" /&gt;&lt;/p&gt;</description></item><item><title>Re: Validating on insert</title><link>http://forums.asp.net/thread/3082476.aspx</link><pubDate>Sun, 12 Apr 2009 19:08:42 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3082476</guid><dc:creator>sksmum</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3082476.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1145&amp;PostID=3082476</wfw:commentRss><description>&lt;p&gt;The Issue is solved &lt;/p&gt;&lt;p&gt;i changed my code&amp;nbsp; from&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;b&gt;var result = this.Projects.FirstOrDefault(c =&amp;gt; c.ProjectID == instance.ProjectID); &lt;/b&gt;&lt;br /&gt;to&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp; &lt;b&gt;var DC = new TMSDataContext();&lt;br /&gt;&amp;nbsp;&amp;nbsp; var result = DC.Projects.FirstOrDefault(c =&amp;gt; c.ProjectID == instance.ProjectID);&lt;/b&gt; &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;when i use &lt;b&gt;this&lt;/b&gt; the result is always &lt;b&gt;! null &lt;/b&gt;( why no idea )&lt;/p&gt;&lt;p&gt;&amp;nbsp; &lt;br /&gt;&lt;/p&gt;&lt;p&gt;when&amp;nbsp; i tested with new project i had used &lt;b&gt;DC&lt;/b&gt; and not &lt;b&gt;this&lt;/b&gt; that is why it worked when changed to &lt;b&gt;this&lt;/b&gt; its not working&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Validating on insert</title><link>http://forums.asp.net/thread/3082103.aspx</link><pubDate>Sun, 12 Apr 2009 14:45:16 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3082103</guid><dc:creator>sjnaughton</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3082103.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1145&amp;PostID=3082103</wfw:commentRss><description>&lt;p&gt;Thats what Sherlock Holmes would say &lt;img src="http://forums.asp.net/emoticons/emotion-2.gif" alt="Big Smile" /&gt; you can always send my the script for a table that gives you a problem and some sample data just a couple of rows and I&amp;#39;ll test it here &lt;img src="http://forums.asp.net/emoticons/emotion-2.gif" alt="Big Smile" /&gt;&lt;/p&gt;</description></item><item><title>Re: Validating on insert</title><link>http://forums.asp.net/thread/3081971.aspx</link><pubDate>Sun, 12 Apr 2009 12:58:07 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3081971</guid><dc:creator>sksmum</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3081971.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1145&amp;PostID=3081971</wfw:commentRss><description>&lt;p&gt;I 1st tried with only one table and then&amp;nbsp; created a new Test table and tested it&lt;/p&gt;&lt;p&gt;i do not have any sprocs in database yet&lt;/p&gt;i tried with AdventureWorks , i create a test table, it works fine&amp;nbsp; &lt;br /&gt;&lt;p&gt;&amp;nbsp;i think it must be some database issue &lt;/p&gt;</description></item><item><title>Re: Validating on insert</title><link>http://forums.asp.net/thread/3081912.aspx</link><pubDate>Sun, 12 Apr 2009 12:13:39 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3081912</guid><dc:creator>sjnaughton</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3081912.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1145&amp;PostID=3081912</wfw:commentRss><description>&lt;p&gt;Have you tried with just the one table? in your new poroject and no sprocs?&lt;/p&gt;</description></item><item><title>Re: Validating on insert</title><link>http://forums.asp.net/thread/3081883.aspx</link><pubDate>Sun, 12 Apr 2009 11:51:21 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3081883</guid><dc:creator>sksmum</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3081883.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1145&amp;PostID=3081883</wfw:commentRss><description>&lt;p&gt;Hi Steve&lt;/p&gt;&lt;p&gt;Thanks&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;It worked fine with NW (SQL Express)&lt;/p&gt;&lt;p&gt;So i created a new project (DD L2S Asp.net 3.5 SP1 ) for my database (SQL Server 2008 Developer Ed)&amp;nbsp; and selected one table&lt;/p&gt;&lt;p&gt;But still its give me the same error even if i enter a new unique value it shows&amp;nbsp; [INR03 already exists as test3]&lt;/p&gt;&lt;p&gt;i created a new table Test with 2 columns TestID INT ( PK, User Input, Not Null )&amp;nbsp; TestName ncar(10) (User Input, Not Null )&lt;/p&gt;&lt;p&gt;No luck, same error&amp;nbsp; &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Validating on insert</title><link>http://forums.asp.net/thread/3081813.aspx</link><pubDate>Sun, 12 Apr 2009 10:52:05 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3081813</guid><dc:creator>sjnaughton</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3081813.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1145&amp;PostID=3081813</wfw:commentRss><description>&lt;p&gt;Hi Sksmum, you sode looks good to my what6 I suspect is you still have the sproc&amp;#39;s in place and they are doing the insert otherwise the result would be from the DB. Somthing weired is going on.&lt;/p&gt;
&lt;p&gt;What I would do is create a new project, create the model,&amp;nbsp;then add the business logic above and debug it test that result is comming from the DB.&lt;/p&gt;
&lt;p&gt;My version with Northwind and Customer works fine. If you are still having issues give it a try with Northwind and post your results here.&lt;/p&gt;</description></item><item><title>Re: Validating on insert</title><link>http://forums.asp.net/thread/3081796.aspx</link><pubDate>Sun, 12 Apr 2009 10:33:39 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3081796</guid><dc:creator>sjnaughton</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3081796.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1145&amp;PostID=3081796</wfw:commentRss><description>&lt;p&gt;&lt;strike&gt;Hi can you post the entire yellow screen error please &lt;img src="http://forums.asp.net/emoticons/emotion-1.gif" alt="Smile" /&gt;&lt;/strike&gt;&lt;/p&gt;
&lt;p&gt;Du! posted to wrong thread &lt;img src="http://forums.asp.net/emoticons/emotion-10.gif" alt="Embarrassed" /&gt;&lt;/p&gt;</description></item><item><title>Re: Validating on insert</title><link>http://forums.asp.net/thread/3081247.aspx</link><pubDate>Sat, 11 Apr 2009 21:37:51 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3081247</guid><dc:creator>sksmum</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3081247.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1145&amp;PostID=3081247</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Hi Steve &lt;/p&gt;&lt;p&gt;I tried the above code to the check duplicate&amp;nbsp; &lt;/p&gt;&lt;p&gt;It throw&amp;#39;s error even for new unique entry &lt;/p&gt;&lt;p&gt;and in the error message the result.name shows the value of the current input and not the already existing value&lt;/p&gt;&lt;p&gt;Basically i can&amp;#39;t insert a new record&amp;nbsp; &lt;br /&gt;&lt;/p&gt;&lt;p&gt;here is my code&lt;/p&gt;&lt;p&gt;public partial class TMSDataContext&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; partial void InsertProject(Project instance)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //var DC = new TMSDataContext();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var result = this.Projects.FirstOrDefault(c =&amp;gt; c.ProjectID == instance.ProjectID);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (result != null)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; throw new ValidationException(String.Format(&amp;quot;{0} already exists as {1}.&amp;quot;, instance.ProjectID, result.Name));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // finally send this to the DB&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.ExecuteDynamicInsert(instance);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;} &lt;br /&gt;&lt;/p&gt;&lt;p&gt;Thanks in advance &lt;br /&gt;&lt;br /&gt;This is my 1st project&amp;nbsp; in ASP.NET&lt;/p&gt;&lt;p&gt;i am using Dynamic Data L2S &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Validating on insert</title><link>http://forums.asp.net/thread/3068522.aspx</link><pubDate>Tue, 07 Apr 2009 07:27:11 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3068522</guid><dc:creator>sjnaughton</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3068522.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1145&amp;PostID=3068522</wfw:commentRss><description>&lt;p&gt;OK I forgot that &lt;img src="http://forums.asp.net/emoticons/emotion-10.gif" alt="Embarrassed" /&gt;. What you do is unmap them after you have testes that they work adn then call them in place of the ExecuteDynhamicInsert etc. also you need to return the PK if it is DB generated on the insert from your SPROC and set the value in the instance before you exit the partial method.&lt;/p&gt;</description></item><item><title>Re: Validating on insert</title><link>http://forums.asp.net/thread/3067717.aspx</link><pubDate>Mon, 06 Apr 2009 23:10:53 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3067717</guid><dc:creator>mdesoysa</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3067717.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1145&amp;PostID=3067717</wfw:commentRss><description>&lt;p&gt;Thanks, I changed the properties of the tables but now I am unable to use a partial class for validation as it says that the member is already defined.&lt;/p&gt;&lt;p&gt;So basically I want to use stored procs for insert/update/delete but prior to this I want to validate as I have been doing before.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Any ideas? &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Validating on insert</title><link>http://forums.asp.net/thread/3067651.aspx</link><pubDate>Mon, 06 Apr 2009 22:19:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3067651</guid><dc:creator>sjnaughton</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3067651.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1145&amp;PostID=3067651</wfw:commentRss><description>&lt;p&gt;That means that the primary output of the sproc does not match the table, but you only need to do this for the select, you can just add the SPROC to the &lt;strong&gt;Methods&lt;/strong&gt; panel and then click the table and use the properties to match the speoc to the relavent CRUD funtion OR right click the table and click Configure behavoir. I you do it this way you can still use ExecuteDynamicInsert etc as L2S will call the relevant SPROC.&lt;/p&gt;</description></item><item><title>Re: Validating on insert</title><link>http://forums.asp.net/thread/3067575.aspx</link><pubDate>Mon, 06 Apr 2009 21:32:04 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3067575</guid><dc:creator>mdesoysa</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3067575.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1145&amp;PostID=3067575</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Hi Sjnaughton,&lt;/p&gt;&lt;p&gt;&amp;nbsp;When I drag the stored procs onto the table in the dbml I get this error: &amp;quot;One or more selected database objects&amp;nbsp; return a schema that does not match the schema of the target class&amp;quot;.&lt;/p&gt;&lt;p&gt; In attempt to sot this out myself I have added insert and updates methods to my BLL file and have used the actual stored proc for insert.&amp;nbsp; I am using the same ListDetails template for a few pages so in the DetailsViewItemInserting event I find what table is being shown and then call my insert method for that table. I have the code below - how do I get a ContainerCode instance which is what the user has just entered? right now that line is returning a new instance which is null...&lt;br /&gt;&lt;/p&gt;&lt;p&gt;VALIDATION AND INSERT CODE in BLL:&lt;/p&gt;&lt;p&gt;// Method for inserting container code&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void InsertContainerCode(ContainerCode instance)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //ContainerCode instance =&amp;nbsp; ContainerCode();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var Fcc = new ParentFccOnlineNettingDataContext();&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Check that the following are unique: --------------------------------------------------------------//&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Container Code &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var container = Fcc.ContainerCodes.FirstOrDefault(c =&amp;gt; c.FCCContainerCode == instance.FCCContainerCode);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //---------------------------------------------------------------------------------------------------//&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // If the container code is unique&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (container != null)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; throw new ValidationException(String.Format(&amp;quot;The Container Code {0} already exists. Please specify a different code.&amp;quot;, instance.FCCContainerCode));&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // finally send this to the DB&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int? insertedId = 0;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Fcc.ContainerCode_Insert(ref insertedId, instance.FCCContainerCode, instance.IsActive);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;/p&gt;&lt;p&gt;&amp;nbsp;LISTDETAILS.ASPX.CS:&lt;/p&gt;&lt;p&gt;&amp;nbsp;protected void OnDetailsViewItemInserting(object sender, EventArgs e)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string tableName = GridDataSource.TableName;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (tableName == &amp;quot;ContainerCodes&amp;quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ContainerCode instance = new ContainerCode();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ContainerCodeBLL container = new ContainerCodeBLL();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; container.InsertContainerCode(instance);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if (tableName == &amp;quot;Supplier&amp;quot;)&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if (tableName == &amp;quot;Market&amp;quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;&lt;/p&gt;&lt;p&gt;Appreciate some help. &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Validating on insert</title><link>http://forums.asp.net/thread/3065968.aspx</link><pubDate>Mon, 06 Apr 2009 09:59:29 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3065968</guid><dc:creator>sjnaughton</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3065968.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1145&amp;PostID=3065968</wfw:commentRss><description>&lt;p&gt;Yes if you map the SPROC&amp;#39;s to the correct table (by dragging them to the table int he L2S designer) then you can just call them instead with the relavent values &lt;img src="http://forums.asp.net/emoticons/emotion-2.gif" alt="Big Smile" /&gt;&lt;/p&gt;
&lt;p&gt;Or you can bind them to the ExecuteDynamicInsert method in the designet see &lt;a href="http://msdn.microsoft.com/en-us/library/bb386946.aspx"&gt;http://msdn.microsoft.com/en-us/library/bb386946.aspx&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Re: Validating on insert</title><link>http://forums.asp.net/thread/3065341.aspx</link><pubDate>Mon, 06 Apr 2009 04:57:38 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3065341</guid><dc:creator>mdesoysa</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3065341.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1145&amp;PostID=3065341</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Hi sjnaughton,&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Is there any way of doing the insert without using ExecuteDynamicInsert? becuase I want to make sure that the user connecting to the database only has grant execute on stored procedures for security purposes. So any insert/updates etc are done via stored procs only.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;Any ideas? &lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>