Đang chuẩn bị liên kết để tải về tài liệu:
Mẹo Lập Trình p 10

Không đóng trình duyệt đến khi xuất hiện nút TẢI XUỐNG

Part 10 Trong mẹo lập trinh hôm nay chúng tôi sẽ hướng dẫn các bạn cách làm thế nào để chương trình tự động tính tổng của một cột trong DataGrid, và hiển thị tổng trong footer của DataGrid. Bạn sẽ dùng một Web Form (calcTotals.aspx) và một đoạn code sau lớp tập tin này (calcTotals.aspx.cs) Sau đây là code calcTotals.aspx | IĨWữlỉW Mil LẬP TRÌNH Parl 10 TR TR TD b Description of File b TD TD asp TextBox RUNAT server WIDTH 239 ID txtDescription MAINTAINSTATE false TD TR TR TD asp Label RUNAT server ID txtMessage FORECOLOR red MAINTAINSTATE false TD TD asp Button RUNAT server WIDTH 239 ONCLICK Button_Submit TEXT Upload Image TD TR TABLE FORM BODY HTML Đằng sau WEB Form Code namespace Uploadsample public class Main System.Web.UI.Page protected System.Web.UI.HtmlControls.HtmlInputFile UP_FILE protected System.Web.UI.WebControls.TextBox txtDescription protected System.Web.UI.WebControls.Label txtMessage protected System.Int32 FileLength 0 protected void Button_Submit System.Object sender System.EventArgs e System.Web.HttpPostedFile UpFile UP_FILE.PostedFile FileLength UpFile.ContentLength try if FileLength 0 txtMessage.Text b You must pick a file to upload b else System.Byte FileByteArray new System.Byte FileLength System.IO.Stream StreamObject UpFile.InputStream StreamObject.Read FileByteArray 0 FileLength System.Data.OleDb.OleDbConnection Con new System.Data.OleDb.OleDbConnection Provider SQLOLEDB Data Source localhost Integrated Security SSPI Initial Catalog northwind System.String SqlCmd INSERT INTO Images Image ContentType ImageDescription ByteSize vAlUES System.Data.OleDb.OleDbCommand OleDbCmdObj new 66 Copyright http vndownloads.net System.Data.OleDb.OleDbCommand SqlCmd Con OleDbCmdObj.Parameters.Add @Image System.Data.OleDb.OleDbType.Binary FileLength .Value FileByteArray OleDbCmdObj.Parameters.Add @ContentType System.Data.OleDb.OleDbType.VarChar 50 .Value UpFile.ContentType OleDbCmdObj.Parameters.Add @ImageDescription System.Data.OleDb.OleDbType.VarChar 100 .Value txtDescription.Text OleDbCmdObj.Parameters.Add @ByteSize System.Data.OleDb.OleDbType.VarChar 100 .Value UpFile.ContentLength Con.Open OleDbCmdObj.ExecuteNonQuery Con.Close txtMessage.Text p b Your image has been uploaded b catch System.Exception ex txtMessage.Text ex.Message.ToStringO Bởi vì giới hạn của kiểu data type .

Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.