- 强制转换: Convert
- 获得系统时间:DateTime
- 数据库返回为空的值: DBNull.Value
- 关于DropDownList.Text 无法赋值:赋值的话,Text所指的值必须存在。Text 为 DropDownList.DataValueField 的值(从现在看来)
- DropDownList必须在设置属性AutoPostBack为True时,Event里的SelectedIndexChanged才回被调用
- StreamWriter:在实例化的时候,参数 append 为 false 会覆盖写入的文件;为true,反之。
using
Excel = Microsoft.Office.Interop.Excel;
- FileStream,StreamWirter,BinaryWriter在写文本的一些差异:
- FileStream 在输入二进制流进文本时,会在最后面(自己的输入结束后)自动添加一些换行符(X0A)或制表符(X09),得到一些不想要的结果
- StreamWriter 用来写文本的话,会有三字节的文件头
- BinaryWriter 写入文本时,所见即所得
- 下面这句是实现在 gridView 里嵌套的 DropDownList 内绑定数据,这样就不用一个一个的DropDownList 去赋值了
- <asp:GridView ID="gridView" runat="server" AutoGenerateColumns="False"
AllowPaging="True" AllowSorting="True"
onrowediting="gridViewl_RowEditing" >
<Columns>
<asp:TemplateField HeaderText="位置">
<ItemTemplate>
<asp:DropDownList ID="dropDonwListCasterPosition" runat="server" DataSource="<%# DataBind()%>"
DataValueField="ID" DataTextField="Description">
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
- 在网页弹出信息: ClientScript.RegisterStartupScript(typeof(string), "js", "alert('行索引:" + row.RowIndex + "');", true);