Imports SystemImports System.DataImports System.Data.SqlClientImports System.DiagnosticsNamespace DAL Public Class DataAccess Implements IDisposable Private strConnection As String = ConfigurationSettings.AppSettings("conString") Private command As SqlCommand Public Sub New(ByVal sprocName As String, ByVal commandType As CommandType, Optional ByVal parameters As SqlParameter() = Nothing) command = New SqlCommand(sprocName, New SqlConnection(strConnection)) command.CommandType = commandType If Not IsNothing(parameters) Then Dim parameter As SqlParameter For Each parameter In parameters command.Parameters.Add(parameter) Next End If command.Connection.Open() End Sub Public Sub New(ByVal sprocName As String, ByVal parameters As ArrayList) command = New SqlCommand(sprocName, New SqlConnection(strConnection)) command.CommandType = CommandType.StoredProcedure Dim parameter As SqlParameter For Each parameter In parameters command.Parameters.Add(parameter) Next command.Connection.Open() End Sub Public Function runNonQuery_Int() As Int32 If IsDBNull(command) Then Throw New ObjectDisposedException("Object is disposed") End If Dim retVal As Integer = 0 retVal = command.ExecuteNonQuery() Return retVal End Function Public Function runUpadateQuery_Int(Optional ByVal strRetParamName As String = "") As Int32 If IsDBNull(command) Then Throw New ObjectDisposedException("Object is disposed") End If Dim i As Integer i = command.ExecuteNonQuery() If i = 0 Then Return 0 Else If strRetParamName = "" Then Return i Else Return command.Parameters("@" & strRetParamName).Value End If End If End Function Public Function runScalar_Obj() As Object If IsDBNull(command) Then Throw New ObjectDisposedException("Object is disposed") End If Return (command.ExecuteScalar()) End Function Public Function runReader_Rd() As SqlDataReader Dim rdr As SqlDataReader If IsDBNull(command) Then Throw New ObjectDisposedException("Object is disposed") End If rdr = command.ExecuteReader() Return rdr End Function Public Function runAdapter_Dt() As DataTable 'hh If IsDBNull(command) Then Throw New ObjectDisposedException("Object is disposed") End If Dim dataAdapter As SqlDataAdapter Dim dataTable As DataTable dataAdapter = New SqlDataAdapter dataTable = New DataTable dataAdapter.SelectCommand = command dataAdapter.Fill(dataTable) dataAdapter.Dispose() Return dataTable End Function Public Sub Dispose() Implements System.IDisposable.Dispose If Not IsDBNull(command) Then Dim tmpsqlcon As SqlConnection tmpsqlcon = command.Connection Debug.Assert(Not IsDBNull(tmpsqlcon)) command.Dispose() tmpsqlcon.Dispose() End If End Sub End ClassEnd Namespace
Similar scripts
Asp Login Multilanguage
(Popularity: ) : The script, written in Asp, was made for those people that need forms and administrative panels in several languages.
You can easily change the language of the client and the administrative pages and put the script in every site you want.
With ... ActiveX UserManager
(Popularity: ) : Features Include: User account and group manipulation, Add and remove users and groups, Add and remove user from a group. Domain servers enameration, Local and global group enameration, User enameration, Group members and user groups enumeration, User account properties, Last ... Uk Postcode Authentity Checker
(Popularity: ) : This little asp script uses MS XMLParser to check the validity of any UK postcode. It can be easily adapted to be added to forms to stop users progressing without a valid UK Postcode. Ideal for UK webmasters who want ... LoginNow
(Popularity: ) : LoginNow also redirects users to originally requested pages. It also Saves, Refreshes, Deletes login data into cookies if so desired by user. My ASP Page Lock
(Popularity: ) : My ASP Page Lock is an easy and fast way to restrict access to any page in your site. Completely idiot proof, you should have no trouble installing and using it within a matter of minutes. Uses only one password, ... VT-Auth v1.0
(Popularity: ) : ASP VT-Auth allows you to have a global authentication system for members of your website, protect any number of pages and directories. You don't need MS Access, mySQL or SQL databases to store usernames and passwords! All login information stored ... AJLogin Ultra-Lite
(Popularity: ) : AJLogin Ultra-Lite is Windows compatible. AJLogin is a user friendly user management/user authentication. This script has just undergone a complete overhaul and now boasts faster page load times and much cleaner code. Advanced Password Protection and User Registration
(Popularity: ) : This is a very secure login process that uses cookies. Unlimited numbers of users can register, and its easy and fast to implement onto your website. Ideal for website who there is a need for visitor interactivity. Password Login Protection
(Popularity: ) : This is a program that can be used by the administrators to build a system for authenticating users by checking against the stored password and user names. This program will be useful for the administrators to manage their users. This ... User Management Module
(Popularity: ) : User Management Module include file to control entire user management process of login, registration & administration. CSS based layout to control look and feel of the entire site. Confirms user email address. Password lookup by email. Email component selection. Support ...
User reviews
Similar Software
Database Independent Abstraction Layer for
(Popularity: ) : Database Independent Abstraction Layer for C (libdbi) implements a database-independent abstraction layer in C, similar to the DBI/DBD layer in Perl.
Writing one generic set of code, programmers can leverage the power of multiple databases and multiple simultaneous database connections by ... CopyToDVD
(Popularity: ) : CopyToDVDs brand new interface makes it easy to create or copy data, audio or video DVDs or CDs including double layer. Access all of VSO-Software's products from within one interface. CopyToDVD supports a wide range of third party software making ... dual DVD copy Platinum
(Popularity: ) : Dual DVD copy Platinum allows to make copy of the Video-DVD disc to DVD-R/RW, DVD+R/RW, DVD+R9(Dual Layer) or CD-R/RW media. For this purpose you need the DVD-RW, DVD+RW or CD-RW burning drive. Also you can save movie as AVI file ... DVDXStudio
(Popularity: ) : Perfect DVD copies by 1:1 or 1:2 without distortion. creates dvd the same as the DVD movie you bought. Super fast copying and burning engine inside,copy and burn within 20-40 minutes. Copy a dual-layer (D9) movie into one dual-layer (D9) ... Image Inc.
(Popularity: ) : The purpose of this software is to blend existing images in a very fast and easy way, using a layer mask for transparency. The process is simple ... load a base image, top layer plus mask and they are automatically ... DVD Cloner 3
(Popularity: ) : DVD-Cloner III Backup your DVD movie to DVD+(-)R/RW easily. Support most of popular DVD+(-) R/RW burners. With this software, you can get your DVD backup in 2 hours. Download DVD Cloner III and try it FREE!
FEATURES:
- Copy DVDs ... DeKlarit
(Popularity: ) : DeKlarit is the only Model Driven tool that combines agile database modeling, declarative business rules, automatic code generation and seamless integration with Microsoft Visual Studio.
DeKlarit is the unique data modeling and code generation tool that enables you to concurrently ... ComparePSD
(Popularity: ) : ComparePSD allows you to quickly compare two Adobe Photoshop PSD files layer-by-layer; ComparePSD handles layers styles (effects), styles attributes and layers visibility flags; ComparePSD provides a scaled view of the files that helps you to find differences easier; ComparePSD allows ... E.M. Multilayer Image Processing SDK
(Popularity: ) : E.M. Multilayer Image Processing SDK is a cross-platform multilayer image processing software development kit. It can process multilayer images on many different platforms. It can add frame, mask and shadow to your images, and convert text to image, and also ... Burn4Free
(Popularity: ) : Burn4Free is a free dvd burning software. Easy to use. Compatible with more than 3000 CD/DVD drives. Copy DVD. Burns data and audio from different files types (WAV, WMA, MP3, OGG, FLAC, WavPack and .CDA (Import from Digital Audio Disc ...