asp.net 与 Oracle,SQL Server,Access 数据库类(1/8)

文章提供这款数据库教程连接代码是一款asp教程.net 与 oracle,sql server,access 数据库类哦, 如果你是asp.net教程开发者那你就爽了啊,这是一款利用了.net可以与oracle,sql server,access 进行连接哦,如果你用其这一种数据库就可以直接使用了,同时也解决了关于各种数据库连接问题。

using system;
using system.collections;
using system.collections.specialized;
using system.data;
using system.data.sqlclient;
using system.data.oledb;
using system.data.oracleclient;
using system.configuration;
using system.reflection;

namespace systemframework.dal
{
/**//// <summary>
/// all rights reserved
/// 数据访问基础类
/// 用户可以修改满足自己项目的需要。
/// </summary>
public class databaselayer
{
//数据库连接字符串(web.config来配置)
//<add key="connectionstring" value="server=127.0.0.1;database=database;uid=sa;pwd=" />
private string connectionstring;
public string conntionstring
{
get
{
return connectionstring ;
}
set
{
connectionstring = value;
}
}

public databaselayer(string strconnect,string datatype)
{
this.conntionstring = strconnect;
this.dbtype = datatype;
}

public databaselayer()
{
this.connectionstring = configurationsettings.apps教程ettings["connectionstring"] ;
this.dbtype = configurationsettings.appsettings["datatype"] ;
}

/**//// <summary>
/// 数据库类型
/// </summary>
private string dbtype;
public string dbtype
{
get
{
if ( dbtype == string.empty || dbtype == null )
{
return "access";
}
else
{
return dbtype;
}
}
set
{
if ( value != string.empty && value != null )
{
dbtype = value;
}
if (dbtype ==string.empty || dbtype == null)
{
dbtype = configurationsettings.appsettings["datatype"];
}
if ( dbtype == string.empty || dbtype == null )
{
dbtype = "access";
}
}
}

 

首页 1 2 3 4 5 6 7 8 末页

时间: 2024-08-31 09:57:08

asp.net 与 Oracle,SQL Server,Access 数据库类(1/8)的相关文章

asp.net下Oracle,SQL Server,Access万能数据库通用类

复制代码 代码如下: using System; using System.Collections; using System.Collections.Specialized; using System.Data; using System.Data.SqlClient; using System.Data.OleDb; using System.Data.OracleClient; using System.Configuration; using System.Reflection; nam

ASP.net如何连接SQL SERVER 2012数据库_实用技巧

在web.config文件中添加 <connectionStrings> <add name="SQLConnectionString" connectionString="Data Source=服务器名;Initial Catalog=数据库名;Integrated Security=True" providerName="System.Data.SqlClient" /> </connectionStrings

ASP.NET2.0连接SQL Server数据库详解

asp.net|server|数据|数据库|详解 本文将详细介绍如何使用Connection对象连接数据库.对 本文将详细介绍如何使用Connection对象连接数据库.对于不同的.NET数据提供者,ADO.NET采用不同的Connection对象连接数据库.这些Connection对象为我们屏蔽了具体的实现细节,并提供了一种统一的实现方法. Connection类有四种:SqlConnection,OleDbConnection,OdbcConnection和OracleConnection.

直接获取Access、SQL Server等数据库数据

access|server|数据|数据库 直接获取access.SQL Server等数据库数据Author: MixPST,Ph4nt0m Security Teamhttp://www.ph4nt0m.org 当使用SQL注入access的时候,经常会遇到密码为中文.猜不到关键字段名这样的问题.使用本技术就能够很快速的解决这样的问题.本技术最低要求有两条: 1.使用access数据库的系统存在SQL注入漏洞:mssql数据库也支持这个技术2.需要知道欲爆数据所在的表的表名以及这个表下的一个字

免费1000M sql server/access/asp/.net免费空间

免费1000M sql server/access/asp/.net免费空间 免费空间初始大小为1000M,可按需申请提升到更大的空间: 免费空间支持绑定国际域名.二级域名等: 免费空间支持数据库,支持SQL Server, Access等: 本站免费空间拥有强大便捷的在线管理后台: 24×7的FTP访问管理,空间脚本支持 ASP, ASP.net等: 在线技术支持,空间的申请及备案等工作有专员协助您完成: 免费空间采用顶级门户网站才会采用的分布式集群技术架构: http://www.06la.

ASP视频教程:备份和还原SQL Server 2000数据库

大家在初学ASP程序的时候,我们经常第一个任务就是配置环境!在这里根据网页教学网站长的经验,有时克隆版的XP系统有时是安装不了IIS的!前面我们已经讲解了ASP视频教程:制作网站前台首页,本讲主要讲述备份和还原SQL Server 2000数据库.大家请看视频教程.

将ACCESS的数据库转化为SQL SERVER的数据库的几点体验

access|server|数据|数据库 最近忙于将ACCESS的数据库转化为SQL SERVER的数据库的学习,从中摸索出几条经验,与大家分享.1.ACCESS的数据库中的自动编号类型在转化时,sql server并没有将它设为自动编号型,我们需在SQL创建语句中加上identity,表示自动编号!2.转化时,跟日期有关的字段,SQL SERVER默认为smalldatetime型,我们最好将它变为datetime型,因为datetime型的范围比smalldatetime型大.我遇见这种情况

ASP.NET备份恢复Sql Server数据库

本文将向大家介绍如何使用 ASP.NET 备份恢复 Sql Server 数据库,大家可以做个参考,也希望对大家有所帮助. 备份SqlServer数据库: string SqlStr1 = "Server=(local);database='" + this.DropDownList1.SelectedValue + "';Uid=sa;Pwd=";string SqlStr2 = "backup database " + this.DropDo

我在使用VS写asp.net,web应用程序中如何连sql server 接数据库

问题描述 我在使用VS写asp.net,web应用程序中如何连sql server 接数据库 10C 在web程序中我需要连接数据库,使用其中的数据.怎样才能用js与我的sql server2012连接,有没有具体的列子啊!新手求大神解答. 解决方案 用js与数据库连接还是第一次听说,你如果需要执行数据操作是需要后端语言的,Web应用在后台代码中可以用ADO.NET技术来进行数据操作.可以前台js 使用Ajax Post后者Get请求后端接口,后端进行数据库的增删改查.如果是服务器控件直接在事件