Gary, I agree. I like your example much better. That seems much 
easier/simpler than any other posts so far. Thanks!

--- In [EMAIL PROTECTED], "Gary Pupurs" <gp-
[EMAIL PROTECTED]> wrote:
> > it was exactly what i was looking for and it works great.
> > see below..
> >
> > //get the highest primary key value in the datatable.
> > int MaxPKey = Convert.ToInt16(ds.Tables[0].Compute("MAX
> > (pay_adjust_id)","pay_adjust_id <> -1"));
> >
> > //add the new primary key
> > dr["pay_adjust_id"] = MaxPKey + 1;
> 
> That may work, but is still more complex and harder for someone 
else to
> follow than:
> 
> ds.Tables[0].Columns["pay_adjust_id"].AutoIncrement = true;
> DataRow dr= ds.Tables[0].NewRow();
> // ...assign the fields, except primary key
> ds.Tables[0].Rows.Add(dr);
> 
> Something to keep in mind for the future...



------------------------ Yahoo! Groups Sponsor --------------------~--> 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/saFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to