1.在设计表的问题,假如有100来条字段,是把它们放到同一表里面,还是把它们分开成几个关联的表。如果一天有1000条记录,而且有意外还要加字段。这2种方法哪个比较好。它们之间的差别大吗? 2.
public UserModel Login(UserModel um) this.com.commondtext="select * from a";
this.com.Parameters.Add("@username",SqlDbType.VarChar,10);
this.com.Parameters[“@username”].Value = um.Username;
this.com.Parameters.Add("@password",SqlDbType.VarChar,10);
this.com.Parameters[“@password”].Value = um.Password;
是上面的代码好呢还是下面的好
public UserModel Login(UserModel um) this.com.commondtext="select * from a";
this.com.Parameters.Add("@username",SqlDbType.VarChar,10);
this.com.Parameters[0].Value = um.Username;
this.com.Parameters.Add("@password",SqlDbType.VarChar,10);
this.com.Parameters[1].Value = um.Password;
public UserModel Login(UserModel um) this.com.commondtext="select * from a";
this.com.Parameters.Add("@username",SqlDbType.VarChar,10);
this.com.Parameters[“@username”].Value = um.Username;
this.com.Parameters.Add("@password",SqlDbType.VarChar,10);
this.com.Parameters[“@password”].Value = um.Password;
是上面的代码好呢还是下面的好
public UserModel Login(UserModel um) this.com.commondtext="select * from a";
this.com.Parameters.Add("@username",SqlDbType.VarChar,10);
this.com.Parameters[0].Value = um.Username;
this.com.Parameters.Add("@password",SqlDbType.VarChar,10);
this.com.Parameters[1].Value = um.Password;
------------------
看需求,一般要遵循三级范式,比如一对多关系就要分表