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;
 
相关文档:
用VS开发ASP.NET网站程序的时候,会将类或Web Services放在特殊的文件夹中,凡是放在这些特殊的文件夹中(App_Themes除外)的程序或内容只允许应用程序访问,对于网页的Request则不予响应(无法读取).
文件夹 &nbs ......
(转 原文地址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这两个关键字有什么意义, ......
///C#中的媒体播放类
using System;
namespace ConfigTools
{
/// <summary>
/// PlayClass 的摘要说明。
///原作CSDN,经本人稍加修改
/// </summary>
public class PlayClass
{
public PlayClass()
{
......
System.Drawing.Image imgPhoto = System.Drawing.Image.fromFile("图片路径名");
int sourceWidth = imgPhoto.Width; //图片宽度
int sourceHeight = imgPhoto.Height; //图片高度
控件名.PostedFile.ContentLength &n ......