📄 fanclubpictures.aspx.cs
字号:
using System;
using System.IO;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
partial class FanClubPictures : System.Web.UI.Page
{
protected void PictureUploaded( object sender, PictureUpload.FileUploadEventArgs e)
{
// add the image to the gallery table
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["WroxUnited"].ConnectionString);
SqlCommand cmd = new SqlCommand("INSERT INTO GALLERY(FixtureID, UploadedByMemberName, Notes, PictureURL) VALUES(@FixtureID, @UploadedByMemberName, @Notes, @PictureURL)", conn);
cmd.Parameters.Add("@FixtureID", SqlDbType.Int).Value = Convert.ToInt32(FixtureList1.SelectedValue);
cmd.Parameters.Add("@UploadedByMemberName", SqlDbType.VarChar, 50).Value = User.Identity.Name;
cmd.Parameters.Add("@Notes", SqlDbType.VarChar, 255).Value = txtNotes.Text;
cmd.Parameters.Add("@PictureURL", SqlDbType.VarChar, 50).Value = e.FileName;
conn.Open();
cmd.ExecuteNonQuery();
conn.Close();
txtNotes.Text = "";
DataList1.DataBind();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -