i have a ASP .NET page which deals with XML files. Whenevr new XML created from other page.. this page gets some fields from that file and puts in the database. now if two new files created in diffrence of 2 seconds or less then this page doesnt insert data correctly. eg. i have auto generated ID and second id and name and blah balh.... second ID is the name+autogeneratedID. now problem is in the database autogenerated ID increases by one. but when i insert second_id it is not grabbing the autogenerated ID correctly.. it is grabbing the previous one instead of current index. <BR><BR>Here is my code<BR><BR> cmdfile_id.CommandType = CommandType.Text<BR> cmdfile_id.CommandText = "select ID = IDENT_CURRENT(&#039;table&#039;)"<BR> sqlDataAdapter.SelectCommand = cmdid<BR> Dim myReader As SqlDataReader = cmdid.ExecuteReader(CommandBehavior.CloseConnectio n)<BR> While myReader.Read()<BR> ID = myReader.GetDecimal(0)<BR> End While<BR> myReader.Close()<BR> sqlDataAdapter.Dispose()<BR> sqlConn.Close()<BR> secondid = name1 + CType(ID + 1, String)<BR><BR>so basically it returns me old ID [= IDENT_CURRENT(&#039;table&#039;)]<BR><BR>help me