Sure you should be using code like this (I have drawn attention to relevant lines)
Dim dtSuperTrace As New DataTable With dtSuperTrace ' These are the ticket these 3 Lines!!!!! .Columns.Add(New DataColumn("ID", GetType(Integer))) .Columns(0).AutoIncrementStep = 1 .Columns(0).AutoIncrement = True ' These are the ticket these 3 Lines!!!!! .Columns.Add(New DataColumn("Caller", GetType(String))) .Columns.Add(New DataColumn("LogType", GetType(String))) .Columns.Add(New DataColumn("EventDescription", GetType(String))) .Columns.Add(New DataColumn("EventTickCount", GetType(Long))) .Columns.Add(New DataColumn("Elapsed", GetType(Long))) End With dsTemp.Tables.Add(dtSuperTrace) If you want to learn coding tricks reading source like the starter kits or a library like UtilityBelt shows you lots of real-world techniques. http://www.learnasp.com/freebook/learn/utilitybelt_lib.aspx At 05:11 PM 8/16/2004, you wrote: >To be clear, I want to add a new row to my DataTable, not to my >actual database. The problem i am running into is that when I attempt >to do the following.. > >DataRow dr= ds.Tables[0].NewRow(); >dr["pay_adjust_id"] = //needs unique value here for primary key >dr["pay_adjust_vers_id"] = add_pay_adjust_vers_id; >dr["ctype_grp_cd"] = add_ctype_grp_cd; >dr["pay_adjust_type_cd"] = "P"; >dr["proj_fy"] = add_proj_fy; >dr["proj_fm"] = add_proj_fm; >dr["prcnt"] = addPCNT; >dr["narrative"] = addNAR; > >ds.Tables[0].Rows.Add(dr); > >it needs a unique value for the primary key. Does anyone know how I >can come up with a unique value for my primary key column? Thanks! ---------- --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.735 / Virus Database: 489 - Release Date: 8/6/2004 [Non-text portions of this message have been removed] ------------------------ Yahoo! Groups Sponsor --------------------~--> Yahoo! Domains - Claim yours for only $14.70 http://us.click.yahoo.com/Z1wmxD/DREIAA/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/