Asp.net使用Sqlite数据库
1. 从http://sqlite.phxsoftware.com 下载System.Data.SQLite.dll
2. 从http://www.sqlite.org/download.html 下载 sqlite3.dll
3. Copy 以上2个Dll到Asp.net网站的bin目录下,类似 E:\2009work\MyWeb\Bin
4. 用sqlitespy 工具新建数据库,E:\2009work\MyWeb\App_Data\db.db3 ,并且新建表CREATE TABLE User(name char(50), Pwd char(20));,插入几条测试数据
5. 编码:
(1)添加引用:E:\2009work\MyWeb\Bin\System.Data.SQLite.dll
(2)using System.Data.SQLite;
(3)
private string _RootPath;
/// <summary>
/// 系统的根目录
/// </summary>
public string RootPath
{
get
{
_RootPath = HttpContext.Current.Server.MapPath(HttpContext.Current.Request.ApplicationPath). ToLower();//当前的绝对路径
if (_RootPath.Length == 1)
{
_RootPath = "";
}
return _RootPath;
}
}
protected void Page_Load(object sender, EventArgs e)
{
if (!IsCallback)
{
相关文档:
来源:http://www.code-123.com/html/2009917202320580.html
1.跟踪页面执行
设置断点是页面调试过程中的常用手段,除此之外,还可以通过查看页面的跟踪信息进行错误排查以及性能优化。ASP.NET中启用页面跟踪非常方便,只需在Page指令中加入Trace="True"属性即可:
......
一、效果图
1.简单属性
2.下拉框属性
3.颜色属性
4.包含属性
5.集合属性
编辑器
6.日期属型
二、程序代码
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Draw ......
将ViewState持久化保持在服务器端文件的代码,这样ViewState不占用网络带宽,因此其存取只是服务器的磁盘读取时间。并且它很小,可以说是磁盘随便转一圈就能同时读取好多ViewState,因此可以说“不占时间”。为了再“不占磁盘时间”,我还使用了缓存。
创建一个基类:
public class
BasePage : Sys ......
using System;
using System.Web;
using System.Text.RegularExpressions;
public static string NoHTML(string Htmlstring)
{
//删除脚本
Htmlstring = Regex.Replace(Htmlstring,@"<script[^>]*?>.*?&l ......
public ActionResult LoadRegionPerformance(TGProject.Models.WModels.TgsOutachiveCondition condition)
{
Account account = (Account)Session["Account"];
var questions = SP.TgsAreaShow(int.Parse(account.AREAID.ToString()));
List< ......