在sql server 建立一個procedure 
============================================================

ylw1125 發表在 痞客邦 留言(0) 人氣()

下載路徑:https://drive.google.com/folderview?id=0B8BYVFwwzT1ZVjR1T3dxRjNQdGc&usp=sharing
解壓縮後,執行instnwnd.sql (利用 microsoft sql server management studio開啟)

ylw1125 發表在 痞客邦 留言(0) 人氣()

listbox.PNG
 
protected void Page_Load(object sender, EventArgs e)
    {
        //動態產生左右各一的listbox,並做初始值設定-----------開始
        ListBox leftlist = new ListBox();
        ListBox rightlist = new ListBox();
        leftlist.SelectionMode = ListSelectionMode.Multiple;
        rightlist.SelectionMode = ListSelectionMode.Multiple;
        leftlist.ID = "leftlist";
        leftlist.Width = 200;
        leftlist.Font.Size = 14;
        leftlist.Height = 300;
        rightlist.ID = "rightlist";
        rightlist.Width = 200;
        rightlist.Font.Size = 14;
        rightlist.Height = 300;
        //動態產生左右各一的listbox,並做初始值設定-----------結束

ylw1125 發表在 痞客邦 留言(0) 人氣()

    protected void Page_Load(object sender, EventArgs e)
    {
        //動態建立10個文字框;
        for (int i = 1; i <= 10; i++)
        {
            TextBox tb = new TextBox();
            tb.ID = "textbox" + i;
            tb.Width = 100;
            tb.AutoPostBack = true;

ylw1125 發表在 痞客邦 留言(0) 人氣()

九九乘法表.PNG
   
protected void Page_Load(object sender, EventArgs e)
    {
        Table mytable = new Table();
        mytable.GridLines = GridLines.Both;
        Page.Controls.Add(mytable);
        for(int i = 1; i < 10; i++)
        {
            TableRow myrow = new TableRow();
            mytable.Rows.Add(myrow);
            for (int j = 1; j < 10; j++)
            {
                TableCell mycell = new TableCell();
                mycell.Text = j + "×" + i + "=" + i * j;
                myrow.Cells.Add(mycell);
            }
        }

ylw1125 發表在 痞客邦 留言(0) 人氣()

        TextBox1.Style["background-color"] = "#EEEE00";
        TextBox1.Style["color"] = "blue";
        TextBox1.Style["font-weight"] = "bold";
        TextBox1.Style["border-color"] = "green";
        TextBox1.Style["font-size"] = "60pt";
 

ylw1125 發表在 痞客邦 留言(0) 人氣()

        FileStream myFileStream;
        long fileSize;
        myFileStream = new FileStream(Server.MapPath("/ch01/TextFile.txt"), FileMode.Open);
        fileSize = myFileStream.Length;
        byte[] Buffer = new byte[(int)fileSize];
        myFileStream.Read(Buffer, 0, (int)fileSize);
        Response.BinaryWrite(Buffer);
 

ylw1125 發表在 痞客邦 留言(0) 人氣()

一般來說我們要將頁面中的table我們會這樣寫
<table align="center">
但是如果要寫在css中的話正常的想法會寫成這樣
table {text-align:center}
但這完全是沒效果的
你必需寫成這樣才會真正的置中
table{
margin-left:auto;
margin-right:auto;
}

ylw1125 發表在 痞客邦 留言(0) 人氣()

// 底下這一段IF判別式,是用來防呆,防止一些例外狀況。-- start --
if (Request["p"] == null)
{
p = 1;
}
else
{
if (IsNumeric(Request["p"]))
{
//有任何問題,就強制跳回第一頁(p=1)。
//頁數(p)務必是一個整數。而且需要大於零、比起「資料的總頁數」要少
if ((p != null) & (p > 0) & (p <= Pages))
{
p = Convert.ToInt32(Request["p"]);
}
else
{
p = 1;
}
}
else
{
p = 1;
}
} //上面這一段IF辦別式,是用來防呆,防止一些例外狀況。-- end --

ylw1125 發表在 痞客邦 留言(0) 人氣()

//Pages 資料的總頁數。搜尋到的所有資料,共需「幾頁」才能全部呈現?
int Pages = ((RecordCount + PageSize) - 1) / (PageSize); //除法,取得「商」。

ylw1125 發表在 痞客邦 留言(0) 人氣()

static bool IsNumeric(object Expression)
{
// Variable to collect the Return value of the TryParse method.
bool isNum;
// Define variable to collect out parameter of the TryParse method. If the conversion fails, the out parameter is zero.
double retNum;

ylw1125 發表在 痞客邦 留言(0) 人氣()

webservice
 
先加入服務參考,再後置程式碼輸入以下內容即可。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

ylw1125 發表在 痞客邦 留言(0) 人氣()

1 2 3 4 5
Blog Stats
⚠️

成人內容提醒

本部落格內容僅限年滿十八歲者瀏覽。
若您未滿十八歲,請立即離開。

已滿十八歲者,亦請勿將內容提供給未成年人士。