易截截图软件、单文件、免安装、纯绿色、仅160KB

ASP.NET DBHelper类

using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;
using System.Data.Common;
using System.Data;
namespace DownData.dal
{
    public static class DBHelper
    {
        private static readonly string connectionString =
            "Data Source=.\\newdb;Initial Catalog=downloaddata; uid=sa;pwd=sa";
        private static readonly string providerName ="System.Data.SqlClient";
        //GetConnection 用于获取连接数据库的 connection 对象...
        private static DbConnection GetConnection()
        {
            DbProviderFactory _factory = DbProviderFactories.GetFactory(providerName);
            DbConnection connection = _factory.CreateConnection();
            connection.ConnectionString = connectionString;
            return connection;
        }
        //GetCommand 获取命令参数 command 对象...
        private static DbCommand GetCommand(string commandText, CommandType commandType, DbConnection connection)
        {
            DbCommand command = connection.CreateCommand();
            command.CommandText = commandText;
            command.CommandType = commandType;
          


相关文档:

ASP.NET面试题(二)

(转 原文地址http://blog.sina.com.cn/s/blog_524c848901009e7b.html~type=v5_one&label=rela_nextarticle 作者
李洋的博客
http://blog.sina.com.cn/liiyang)
66.软件开发过程一般有几个阶段?每个阶段的作用?
答:需求分析,架构设计,代码编写,QA,部署
67.在c#中using和new这两个关键字有什么意义, ......

ASP.NET页面传值的方法


在面试的时候,经常会遇到这样的问题,其实我们会对其中的几种方法比较熟悉,因为项目中经常使用。但是要全面的回答ASP.NET中页面传值的方式,估计往往很难全面。
一.
使用QueryString变量
    QueryString是一种非常简单也是使用比较多的一种传值方式,但是它将传递的值显示在浏览器的地址栏中,如果是传递一个或 ......

ASP.NET(C#)实现一次性上传多张图片(多个文件)

在做asp.net的Web开发的时候,我们经常会遇到一次性上传多个文件的需求。通常我们的解决方法是固定放多个上传文件框,这样的解决办法显然是不合理的,因为一次上传多个,就意味着数量不确定。因此我们就要让这些文件上传框动态添加,下面我以我做的一个图库管理中的上传图片的功能为例
先看效果:
打开的初始界面:
默认 ......

JS重置按钮脚本,支持重置ASP.NET控件

开发中经常遇到要重置控件值得操作,下面写了常用HTML控件的重置方法。不完整的,大家可以扩充
function ResetControl() {
            var v = document.forms[0].elements;
            for (var i = ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号