操作数据表主要分为更新和查询
更新
更新包括增添、修改、删除三个功能,首先按正常操作敲好三个功能的代码
SqlConnection sqlConnection = new SqlConnection();
sqlConnection.ConnectionString =
ConfigurationManager.ConnectionStrings["Sql"].ToString();
SqlCommand insqlCommand = new SqlCommand();
insqlCommand.Connection = sqlConnection;
insqlCommand.CommandText =
"INSERT tb_药品信息表"
+ " (ypbh ,ypmc,yplx,dj ,sj,dw,pfj,lsj,jyj ,zdj,kl ,yxq ,cd ,sccj ) "
+ " VALUES(@No,@ypmc ,@yplx ,@dj ,@sj ,@dw,@pfj,@lsj ,@jyj,@zdj,@kl,@yxq,@cd,@sccj )";
insqlCommand.Parameters.Add("@Name", SqlDbType.VarChar, 0, "ypmc");
insqlCommand.Parameters.Add("@yplx", SqlDbType.Bit, 0, "yplx");
insqlCommand.Parameters.Add("@dj", SqlDbType.Float, 0, "dj");
insqlCommand.Parameters.Add("@sj", SqlDbType.Float, 0, "sj");
insqlCommand.Parameters.Add("@dw", S