ASP.NETÖеÄÊý¾Ý¿â²Ù×÷Ààsqlhelper¼°·½·¨Ê¹ÓÃÖ¸ÄÏ
ÒªÔÚVS2005ÖÐʹÓÃsqlhelperÀà,±ØÐë°ÑMicrosoft.ApplicationBlocks.Data.dllÒýÓõ½ÏîÄ¿ÖÐ.
1.ͨ¹ý´æ´¢¹ý³Ì²éѯµÄ·½·¨SqlHelper.ExecuteDataset(Êý¾Ý¿âÁ¬½Ó×Ö·û, ´æ´¢¹ý³Ì×Ö·û, ²ÎÊýÊý×é);
2.ͨ¹ý×Ö·û´®²éѯµÄ·½·¨SqlHelper.ExecuteDataset(Êý¾Ý¿âÁ¬½Ó×Ö·û, CommandType.Text , ²éѯ×Ö·û´®,²ÎÊýÊý×é);
3.ͨ¹ý´æ´¢¹ý³Ì²åÈëµÄ·½·¨SqlHelper.ExecuteScalar(Êý¾Ý¿âÁ¬½Ó×Ö·û, ´æ´¢¹ý³Ì×Ö·û, ²ÎÊýÊý×é);
4.ͨ¹ý×Ö·û´®²åÈëµÄ·½·¨SqlHelper.ExecuteScalar(Êý¾Ý¿âÁ¬½Ó×Ö·û, CommandType.Text , ²åÈë¼°Ë¢ÐÂ×Ö·û´®,²ÎÊýÊý×é);
5.ͨ¹ý´æ´¢¹ý³Ìˢеķ½·¨SqlHelper.ExecuteNonQuery(Êý¾Ý¿âÁ¬½Ó×Ö·û, ´æ´¢¹ý³Ì×Ö·û, ²ÎÊýÊý×é);
6.ͨ¹ý×Ö·û´®Ë¢Ðµķ½·¨SqlHelper.ExecuteNonQuery(Êý¾Ý¿âÁ¬½Ó×Ö·û, CommandType.Text , Ë¢ÐÂ×Ö·û´®,²ÎÊýÊý×é);
ÔËÓÃʵÀý
using System;
using System.Data;
using System.Data.SqlClient;
using Microsoft.ApplicationBlocks.Data;
using System.IO;
namespace SK.VideoDAL
{
/// <summary>
/// File µÄժҪ˵Ã÷¡£
/// </summary>
public class File
{
/// <summary>
/// ÎļþÊý¾Ý·ÃÎÊÀà
/// </summary>
public File()
{
//
// TODO: ÔÚ´Ë´¦Ìí¼Ó¹¹Ô캯ÊýÂß¼
//
}
/// <summary>
/// Ìí¼ÓÎļþ
/// </summary>
/// <param name="FileClassID">Îļþ·ÖÀà±àºÅ</param>
/// <param name="SetCommend">ÍƼö·½Ê½</param>
/// <param name="SetTop">¹Ì¶¥·½Ê½</param>
/// <param name="Name">ÎļþÃû³Æ</param>
/// <param name="Intro">¼ò½é</param>
/// <param name="FileSize">´óС</param>
/// <param name="Grade">ÆÀ¼¶</param>
/// <param name="Keyword">¹Ø¼ü×Ö</param>
/// <param name="PreviewUrl">Ô¤ÀÀͼµØÖ·</param>
/// <param name="MemberID">·¢²¼ÈËID</param>
&nb
Ïà¹ØÎĵµ£º
1¡¢ÔÚcompilation Ï£¬ÇëÉèÖÃdebug=false £¬ÈçÏ£º
default Language="c#" debug="false">
2¡¢ÇëʹÓÃServer.Transfer´úÌæResponse.Redirect¡£
3¡¢Ê¹ÓÃValidator¿Ø¼þ£¬ÇëÒª¾³£¼ì²éPage.IsValid¡£
4¡¢ÇëʹÓÃforeachÑ»·£¬¶ø²»ÊÇΪ×Ö·û´®µü´úÑ»·¡£
5¡¢ÇëʹÓÿͻ§¶ËÑéÖ¤·½Ê½(²»ÒªÃ¿´Î¶¼ÔÚ·þÎñ¶ËÑéÖ¤)¡£
6¡ ......
¸ÅÊö
ÔÚ¿ª·¢SilverlightÓ¦ÓóÌÐòʱ£¬ÎÒÃǾ³£»áÓöµ½ÕâÑùÒ»ÖÖÇé¿ö£¬ÐèÒªÔÚSilverlightÓ¦ÓóÌÐòµÄUserControlÖлñÈ¡ASP.NETÒ³Ãæ²ÎÊý£¬Õâ¸ö²ÎÊý²»Ò»¶¨À´×ÔÓÚµ±Ç°SilverlightÓ¦ÓóÌÐòµÄËÞÖ÷Ò³Ã棬¶øÓпÉÄÜÀ´×ÔÓÚÆäËüµÄASP.NETÒ³Ãæ¡£
±¾ÎÄÎÒÃǼòµ¥µÄ½éÉÜÒ»ÏÂÈçºÎÔÚSilverlightÓ¦ÓóÌÐòÖлñÈ¡ASP.NETÒ³Ãæ²ÎÊý¡£
ÐèÇó
ÈçÏÂÃæµÄ ......
1. ´ò¿ªÐµĴ°¿Ú²¢´«ËͲÎÊý£º //´«ËͲÎÊý£º
response.write("£¼script£¾window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="++"’)£¼/script£¾")
¡¡¡¡//½ÓÊÕ²ÎÊý£º
string a = Request.QueryString("id");
string b = Request.QueryString("id1");
2.Ϊ°´Å¥Ìí¼Ó¶Ô»°¿ò
Button1 ......
1. ʹÓÃQueryString±äÁ¿
¡¡¡¡QueryStringÊÇÒ»Öַdz£¼òµ¥µÄ´«Öµ·½Ê½£¬Ëû¿ÉÒÔ½«´«Ë͵ÄÖµÏÔʾÔÚä¯ÀÀÆ÷µÄµØÖ·À¸ÖС£Èç¹ûÊÇ´«µÝÒ»¸ö»ò¶à¸ö°²È«ÐÔÒªÇ󲻸߻òÊǽṹ¼òµ¥µÄÊýֵʱ£¬¿ÉÒÔʹÓÃÕâ¸ö·½·¨¡£µ«ÊǶÔÓÚ´«µÝÊý×é»ò¶ÔÏóµÄ»°£¬¾Í²»ÄÜÓÃÕâ¸ö·½·¨ÁË¡£ÏÂÃæÊÇÒ»¸öÀý×Ó£º
a.aspxµÄC#´úÂë
private void Button1_Click(object se ......
µÚÒ»²½£º´´½¨¶ÔÏó
µÚ¶þ²½£ºÉèÖÃÊôÐÔ
¢ÙpdsBooks.AllowPaging=true;
¢ÚpdsBooks.PageSize=5;
¢ÛpdsBooks.CurrentPageIndex=CurrentPage-1;
¢ÜpdsBooks.DataSource=BookManage.GetAllBooks();
µÚÈý²½£º°ó¶¨Êý¾ÝÔ´
DataList1.DataList=pdsBooks;
DataList1.DataBind(); ......