<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : Assigning value to key field in table</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce Classic : Assigning value to key field in table</description>
  <pubDate>Thu, 11 Jun 2026 06:30:02 -700</pubDate>
  <lastBuildDate>Mon, 07 Apr 2008 13:01:51 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=756</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>Assigning value to key field in table : forget it. I solved it.  aEventStep...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=756&amp;PID=2782#2782</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=202" rel="nofollow">BillG</a><br /><strong>Subject:</strong> 756<br /><strong>Posted:</strong> 07-Apr-2008 at 1:01pm<br /><br />forget it.&nbsp; I solved it.<DIV>&nbsp;</DIV><DIV>aEventStep&#091;"EventID"&#093; = eventId;</DIV><DIV>aEventStep&#091;"EventStepId"&#093; = stepId;</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>Bill</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Mon, 07 Apr 2008 13:01:51 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=756&amp;PID=2782#2782</guid>
  </item> 
  <item>
   <title>Assigning value to key field in table : First off I don&amp;#039;t have a...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=756&amp;PID=2781#2781</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=202" rel="nofollow">BillG</a><br /><strong>Subject:</strong> 756<br /><strong>Posted:</strong> 06-Apr-2008 at 8:51pm<br /><br />First off I don't have a choice about the structure of these tables because I am programming against a database used by other apps.&nbsp; I have two tables that are related.<DIV>&nbsp;</DIV><DIV>Event - Primary Key EventId</DIV><DIV>&nbsp;</DIV><DIV>EventStep which is a child of Event and has the EventId + StepID as the Primary Key and a foreign key of EventId back to the parent.&nbsp; </DIV><DIV>&nbsp;</DIV><DIV>When I create the Event record, I want to retrieve the next value from a table which holds the next EventID.</DIV><DIV>&nbsp;</DIV><DIV>When the step is created I want to do the following.</DIV><DIV>&nbsp;</DIV><FONT size=2><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>public</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>static</FONT></FONT><FONT size=2> </FONT><FONT color=#2b91af size=2><FONT color=#2b91af size=2>EventStep</FONT></FONT><FONT size=2> Create(</FONT><FONT color=#2b91af size=2><FONT color=#2b91af size=2>PersistenceManager</FONT></FONT><FONT size=2> pManager, </FONT><FONT color=#2b91af size=2><FONT color=#2b91af size=2>Int32</FONT></FONT><FONT size=2> eventId, </FONT><FONT color=#2b91af size=2><FONT color=#2b91af size=2>Int32</FONT></FONT><FONT size=2> stepId)</P></FONT><FONT size=2><P>{ </P></FONT><FONT size=2><P></FONT><FONT color=#2b91af size=2><FONT color=#2b91af size=2>EventStep</FONT></FONT><FONT size=2> aEventStep = pManager.CreateEntity&lt;</FONT><FONT color=#2b91af size=2><FONT color=#2b91af size=2>EventStep</FONT></FONT><FONT size=2>&gt;();</P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2><P></FONT></FONT><FONT size=2>aEventStep.EventID = eventId;</P><P>aEventStep.EventStepID = stepId;</P><P>aEventStep.TSCreated = </FONT><FONT color=#2b91af size=2><FONT color=#2b91af size=2>DateTime</FONT></FONT><FONT size=2>.Today;</P><P>aEventStep.DateOccured = </FONT><FONT color=#2b91af size=2><FONT color=#2b91af size=2>DateTime</FONT></FONT><FONT size=2>.Today;</P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2><P></FONT></FONT><FONT size=2>pManager.AddToManager();</P><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>return</FONT></FONT><FONT size=2> aEventStep;</P><P>}</P><DIV></DIV><P>It tells me that I can't do this because EventId and EventStepId are read-only fields.&nbsp; How do I get around this, other than changing the database which isn't an option at this point in time.</P><DIV></DIV>Bill<DIV></DIV></FONT>]]>
   </description>
   <pubDate>Sun, 06 Apr 2008 20:51:50 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=756&amp;PID=2781#2781</guid>
  </item> 
 </channel>
</rss>