Jagjit Saini

Jagjit Saini

  • NA
  • 196
  • 38.6k

Cannot insert explicit value for identity_column in table Meet

Mar 24 2022 5:04 PM

Hi

  Error - Cannot insert explicit value for identity_column in table Meet when Identiy_Insert is set to Off

public void UploadSave(DataTable dt)
{
    try
    {
        foreach (DataRow colum in dt.Rows)
        {
            if (colum[0].ToString().Trim() != "")
            {
                BALLink bALLink = new BALLink();
                Link Result = new Link();
                {
                    Result.AccountID = Convert.ToInt32(colum[0].ToString());
                    Result.Link1 = (colum[1].ToString());
                    int ID = bALLink.Add(Result);

                }
            }
        }
    }
    catch (Exception ex)
    {
        ShowMessage("Oops...", ex.Message, "error");
    }
}

Thanks

 


Answers (1)