十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
public DataSet GetProviderTypeDs() { using (SqlConnection con = new SqlConnection(this.conStr)) { SqlCommand cmd = con.CreateCommand(); cmd.CommandType = CommandType.Text; cmd.CommandText = @"select * from ProviderType"; con.Open(); SqlDataAdapter ada = new SqlDataAdapter(cmd); ada.MissingSchemaAction = MissingSchemaAction.AddWithKey; DataSet ds = new DataSet(); ada.Fill(ds,"ProviderType"); //先设置seed再设置step导致seed设置失败,seed被设置为Table的标识列ID最大值 //ds.Tables[0].Columns[0].AutoIncrementSeed = -1; //ds.Tables[0].Columns[0].AutoIncrementStep = -1; ds.Tables[0].Columns[0].AutoIncrementStep = -1; ds.Tables[0].Columns[0].AutoIncrementSeed = -1; ds.Tables[0].Columns[0].ReadOnly = false; return ds; } }