myCommand.Parameters.Add(parameterCategoryID);
SqlParameter parameterImageData = new SqlParameter("@ImageData ", SqlDbType.Image);
parameterImageData.Value = ImageData ;
myCommand.Parameters.Add(parameterImageData );
SqlParameter parameterNewGrade = new SqlParameter("@NewGrade", SqlDbType.Char ,6);
parameterNewGrade.Value = NewGrade;
myCommand.Parameters.Add(parameterNewGrade);
myConnection.Open();
myCommand.ExecuteNonQuery();
myConnection.Close();
}
//显示详细求购信息。
public SqlDataReader RequireDetail(int ID)
{
// Create Instance of Connection and Command Object
SqlConnection myConnection = new SqlConnection(ConfigurationSettings.AppSettings["ESMS"]);
SqlCommand myCommand = new SqlCommand("RequireDetail", myConnection);
// Mark the Command as a SPROC
myCommand.CommandType = CommandType.StoredProcedure;
// Add Parameters to SPROC
SqlParameter parameterID = new SqlParameter("@ID", SqlDbType.Int );
parameterID.Value = ID;
myCommand.Parameters.Add(parameterID);
// Execute the command
myConnection.Open();
SqlDataReader result = myCommand.ExecuteReader(CommandBehavior.CloseConnection);
// Return the datareader
return result;
}
//显示近期的求购信息。
public SqlDataReader RequireIndex()
{
// Create Instance of Connection and Command Object
SqlConnection myConnection = new SqlConnection(ConfigurationSettings.AppSettings["ESMS"]);
SqlCommand myCommand = new SqlCommand("RequireIndex", myConnection);
// Mark the Command as a SPROC
myCommand.CommandType = CommandType.StoredProcedure;
// Add Parameters to SPROC
// Execute the command
myConnection.Open();
SqlDataReader result = myCommand.ExecuteReader(CommandBehavior.CloseConnection);
// Return the datareader
return result;
}
显示近期的求购信息:
前台代码:
<asp:DataList id="DataList1" runat="server">
<ItemTemplate>
<FONT color="#ff3300" size="2">[求购]</FONT><A target=_blank href='Product\\showRequireDetail.aspx?requireID=<%# DataBinder.Eval(Container.DataItem,"ID") %>'><%# DataBinder.Eval(Container.DataItem,"productName") %></A>
</ItemTemplate>
</asp:DataList>
后台代码:
//绑定供求信息
productDB PDB=new productDB();
DataList1.DataSource=PDB.RequireIndex();
DataList1.DataBind();
添加求购信息:
private void requireAdd_Click(object sender, System.EventArgs e)
{
//get imageData
HttpPostedFile UpFile = imageFile.PostedFile;
int FileLength = UpFile.ContentLength;
Byte[] ImageData =new Byte[FileLength];
Stream StreamObject= UpFile.InputStream ;
StreamObject.Read(ImageData,0,FileLength);
int CompanyID=int.Parse(Session["CompanyID"].ToString());
int ClientID =int.Parse(Session["ClientID"].ToString());
DateTime EndDate=Calendar1.SelectedDate;
productDB PDB =new productDB();
PDB.RequirementAdd(CompanyID,ClientID,name.Text,intro.Value,int.Parse(amount.Text),"¥"+unitPrice.Text+" -¥"+topPrice.Text,
EndDate,int.Parse(Session["CategoryID"].ToString()),ImageData,newGrade.SelectedValue);
}
<< 上一页 [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] ... 下一页 >>
ASP+SQL SERVER2000电子商城系统 第29页下载如图片无法显示或论文不完整,请联系qq752018766