I need to truncate the table having foreign keys. As this is not allowed, I deleted all the rows from the table and re-indexed the identity column of the table as this:
dbcc checkident('employee',reseed, 0)
where, employee is the name of table, reseed specifies that the current identity value should be changed, and, 0 is the new seed value to use in reseeding the identity column
for (int i = 0; i < servers.Rows.Count; i++) { // Remove the following 'if' condition // to list the servers of local machine // along with network servers
// used to get the servers in the local machine if (myServer == servers.Rows[i]["ServerName"].ToString()) { if ((servers.Rows[i]["InstanceName"] as string) != null) comboBox1.Items.Add(servers.Rows[i]["ServerName"] + "\\" + servers.Rows[i]["InstanceName"]); else comboBox1.Items.Add(servers.Rows[i]["ServerName"]); } } }