Asp.net - Improving Data Access Class

Apr 13, 2012

A few years ago we (as a company) faced the scenario of getting our developers to stop writing classic asp pages and switch to .net (and in turn system.data for data access). As a supposedly ˜short term measure I wrote the following class to make the switchover easier for those not used to system.data & all its new objects: [URL] The main purpose of this class was to keep usage as similar to classic asp as possible & keep the usage VERY simple (plus to add email alerts for error catching yada yada yada):

[Code]...

View 2 Replies


ADVERTISEMENT

Sql - Improving Data Access Layer?

May 22, 2009

I am putting some heavy though into re-writing the data access layer in my software(If you could even call it that). This was really my first project that uses, and things were done in an improper manner. In my project all of the data that is being pulled is being stored in an arraylist. some of the data is converted from the arraylist into an typed object, before being put backinto an arraylist.Also, there is no central set of queries in the application.This means that some queries are copy and pasted, which I want to eliminate as well.This application has some custom objects that are very standard to the application, and some queries that are very standard to those objects.

View 5 Replies

Access Data From A Class In A Web Project?

Oct 21, 2010

I have a web site project in which I added a "Class.vb" file to hold public functions/procedures/variables. I'm trying to access a function within this file from my code-behind file from an aspx page. I've called the Class file "Module1"; Publc Class Module1.[code]...

View 3 Replies

Code Review: ADO.NET Data Access Utility Class (VB)?

Mar 6, 2009

When I started at my current employer I inherited a project from a previous developer and in that project was a data access utility class that tries to simplify a lot of the code involved in making calls and retrieving data back from the database. Over time it has been modified to add more overloaded forms of functions, and now I am looking at possible suggestions from the StackOverflow community.What do you think should be added? Removed?odified?Note:It would be nice if this class could remain compatible to VB.NET in the .NET 2.0 framework. We are also developing in 3.5, but I would like to have something that is generally going to work across most frameworks (so no LINQ, etc.) Also, please refrain from unnecessary answers that consist of nothing but "Use nHibernate" or other tools.

My class:
Public Class DataAccess
Public Shared Function ReturnScalar(ByVal CmdStr As String) As String

[code].....

View 2 Replies

Exception Handling In Base Class For Data Access Layer

Mar 14, 2010

I would like to build a base class for my SQL Data Access Layer. I have most of it based out, but have a question about how to handle errors within the base class. I have a method for ExecuteNonQuery, ExecuteReader, ect...

[Code]...

View 18 Replies

VS 2005 : Passing Command Parameters To A Data Access Class?

Mar 31, 2011

I've got a program where the insert/update SQL was created with the values coded directly into the SQL string. I've changed this to use the Command's Parameters.AddWithValue method and all worked well. I'm now in the process of separating the data access code out into it's own class. I've got the Select code working using a DataSet in the form that I pass ByRef to my data class so it can populate or refresh it. My sticking point is in how to pass the parameters for the Insert/Update commands to the class since from the form I no longer have access to a Command object. Do I need to make the Command object in the data access class available to the form?

View 6 Replies

C# - Improving Code And UI Performance?

May 22, 2010

I am dealing with a situation that I need some help with here. I need to improve performance on functionality that records and updates UI with user selection info. What my code current does is

'This is called to update the Database each time the user 'makes a new selection on the UI

Private Sub OnFilterChanged(String newReviewValueToAdd)
AddRecentViewToDB(newReviewValueToAdd)
UpdateRecentViewsUI()
PageReviewGrid.Rebind()'Call Grid Rebind
End Sub

[Code]...

View 2 Replies

Improving The Assigning Operations Of .NET?

Dec 10, 2009

I have an idea about improving the assigning operations of VB.NET (maybe other .NET languages too.) It is similar with "With ... End With" block:

[Code]...

So we don't type "Some Text" every time. Do you think does this idea work? Maybe in the future we can see something like that?

View 3 Replies

.net - Optimistic Concurrency And Improving Solutions?

Mar 19, 2011

In our database we have gigantic tables (it was initially built 20 years ago). We are on the process of developing it.

Some tables contain rowversion and optimistic concurrency. We were wondering if there is a way to just correspond rowversion to the modification of some specific columns, but not all of them. In Normal Case, T-SQL which is generated then would be huge.

View 1 Replies

Graphics Packages For Improving Look And Feel Of UI?

Feb 17, 2012

I am looking for recommendations with regards to any tips and suggestions on the improvement of the look and feel of windows forms designed in vb.net studio.I was used Krypton but my trial ran out and I am looking for other packages, tools or ways to improve the look of my forms.

View 5 Replies

Improving Function - Using Stringbuilder To Replace My Strings?

Jun 21, 2009

vb.net

'strSearch = textBox.Text, columns 2 to 10 are the optional columns you want to search to. Function WhereQuery(ByVal strSearch As String, ByVal column1 As String, Optional ByVal column2 As String = "", Optional ByVal column3 As String = "", Optional ByVal column4 As String = "", Optional ByVal column5 As String = "", Optional ByVal column6 As String = "", Optional ByVal column7 As String = "",[code]..

sample output:

im also thinking on using stringbuilder to replace my strings.

View 1 Replies

Improving Recursive Active Directory Function?

Mar 2, 2012

I'm hoping to improve the performance of the below as well as return the GUID of each user.

I've converted and modified the code found here for searching through groups recursively to get all the members and their details and adding them to a class collection. However I also need to capture the user's managers details so I'm calling the AD twice for each user. This doesn't seem efficient as many of the users will have the same manager. It would seem logical to get the distinct manager details from the collection class and call only these, then replace them wherever they occur in the collection.

I'd also like to be able to get the user's GUID, I've tried accessing it directly as a property of the collection, but it doesn't return anything.

I'm using vs2005 and .Net 2.0

Public Class ADCLass
''' <summary>
''' Calls recursive function to return users in group

[Code]....

View 1 Replies

Asp.net - Improving Code To Find Nodes With Using Attributename And Node

Feb 3, 2012

I have following xml:

[Code]...

It is working but It is very slow. Any alternative of getting this data from XML ?

View 3 Replies

Regex Improving Performance With Compiling And Shared Variables

Sep 30, 2011

I am writing some code that uses fixed regexs to search strings and pattern match. Its simple stuff, but I want to improve regex performance with compiling (its a high traffic website). I was thinking of compiling the regex and putting it in a Shared (static) variable inside a class. Something like this:

[Code]...

View 1 Replies

Access To Object Passed ByRef In The Constructor Of A Class Through Another Part Of The Class?

Aug 18, 2009

I have some classes, BsfciFile and StudyFlashCard. Bsfci is the extension to which I save my set of flashcards in an INI format. I am currently working to transform my code from using Windows API calls to access the INI to using a IniFile class that I found on the internet. I would like the BsfciFile to have a Array of StudyFlashCard objects, but I would like the StudyFlashCard class to use the IniFile class object contained in the BsfciFile class. I can pass the IniFile from the BsfciFile class to the constructor for the StudyFlashCard class, but I want it to modify the same IniFile as the BsfciFile class has later on.

[Code]...

View 1 Replies

Access Members Of A Sub Class Through A Property Of The Parent Class?

Mar 30, 2010

This is a bit of a continuation from a previous post for which AtmaWeapon was very informative.

Problem:
A parent class has a sub class with various properties. A property of the parent class is a List(of T) with T = the sub class The issue is how to store data in the sub class of the instantiated parent

Some example code (hopefully formatted correctly):

Code:
'=========== Class Definitions =============
Public Class courseClass
Public Class timeTableClass

[Code].....

View 7 Replies

Access The Base Class Inside A Derived Class?

Oct 22, 2010

How do I access the base class inside a derived class?

View 1 Replies

Can't Access Class From Code-behind. Class Is App_Code Folder?

Feb 15, 2011

I have a very simple class that is located within my App_Code folder in my VS2008 web application project. I am trying to instantiate an instance of this class from my code-behind file. Intellisense does not seem to be seeing my class and I am not sure why. I am using VB.NET which I am admittedly not that familiar with as compared to C#. Perhaps I am missing something. I would bet it has something to do with something I am missing in VB.NET.Here is my simple class (for testing):

[Code]...

View 2 Replies

Private Read/Write Access And Public Readonly Access For Variable In Class?

Jan 12, 2012

Is it possible to set a variable in my custom class for Private Read/Write access and Public Readonly access without creating Properties with Get and Set? In other words, from within my class I want full access and from my form I only want read access. Right now I declare my variable as either Private or Public to control Public read/write access. I tried googling my question a bit but I'm not sure what the correct terms even ar

View 5 Replies

C# - Access Class And Its Functions From Another Class?

Apr 13, 2010

This is my first major application using multiple classes. It is written in vb and I know about creating objects of the class and using that instance to call functions of the class. But how do I create an object with constructors to allow another program written in C# to access my classes and functions and accept things from the program.

View 3 Replies

Writing Data From Array In One Class To A Listbox In Another Class

Jul 26, 2011

I'm designing a small GUI Windows program that allow staff at a cinema to reserve seats for customers. There will be a total of 60 seats in the cinema. I have two classes in my program:-

1.) MainForm.vb - used for I/O actions and user interaction

2.) SeatManager.vb - used to hold and handle the background methods and functions that make the program work

Here is the code for my MainForm.vb class thusfar:-

Public Class MainForm
Private Const m_totalNumberOfSeats As Integer = 60
Private m_seatManager As SeatManager

[Code]....

Basically, when the program opens, the lstReservations list in the MainForm class will be populated with a total of 60 (m_totalNumberOfSeats) entries to represent 60 seats. Each of these seats will contain the index number from the array m_nameList; this index number (+1) will represent the seat number and then in the lstReservations list, after the seat number, I'd like it to contain the respective entry from the m_nameList array. As all entries will be held in RAM, when the GUI is opened, all m_nameList array entries will be empty. As the user uses the program, they can highlight a row in the lstReservations list and then use the GUI textboxes to enter the customer's name which will then be populated into the respective array entry.

how to, when the GUI opens, ensure that the lstReservations list takes all of the blank entries from the m_nameList array and from there, I can highlight a row to carry out further methods on?

View 1 Replies

Insert Data From An Access Unbounds Form To An Access Table

Jun 9, 2009

I'm trying to insert data from an Access unbounds form to an Access Table using the follwoing code:

View 2 Replies

Access One Class From Another?

Aug 15, 2011

I have a set of XML routines stored in a public class. There is a "sendMessage" function in this class. I'd like to be able to hit a button and have that function executed from my main class.

' Form = Main
Public Class Main
...

[Code].....

View 6 Replies

.net - .NET XML Web Service, Consuming Class Not Able To Access Web Service Class?

Mar 21, 2012

I am creating a simple XML web service and have run into something I can't quite explain.My web service class has the following structure :

Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.ComponentModel

[code]....

Invoking my method using the built in VS web service test harness works fine. I created another project, in another solution, to test consuming the web service. I added a web reference to my project and set it so I could reference my web service by using "localWS". Then in the page load event of my consuming class I tried to instantiate an object of my web service:

Dim srv As New localWS.MyWS

But there was no "MyWS" type found. There is however a localWS.MyWSSoapClient class. When I use it I can invoke my web methods. My question is, why can't I create a straight up version of MyWS class? In the tutorials I'v read, and in the book I have, example consuming classes for .NET XML web services can instantiate objects of the web service class they are consuming. As a further test I added a new web form to my web service project and from there I was able to instantiate a MyWS class.

View 1 Replies

.net - Class And Member Have Different Access?

Apr 13, 2011

I've encountered a problem which challenges my understanding of access modifiers in VB.Net. I have a class declared Friend. If I declare its properties Public, the application works. If I declare them Friend, the application fails.

Before this, I believed that, in a class declared Friend, it would make no functional difference whether I declared the members Public or Friend. I thought class access declarations applied their restrictions to all nested entities, so nested properties declared Public were effectively restricted as if they had been declared Friend. Obviously, I was wrong. Can anyone explain how access modifiers really work, or point me to the relevant documentation?

Here is a more detailed description of the situation: I have a Friend class called StripTask with properties called StripDate, HistorianDate, and TaskText. I have a collection of StripTasks (called _StripTasks) which is used as the data source for a Syncfusion GridDataBoundGrid. The way the binding works, I need to pass the name of a StripTask property to each of the grid columns so each column knows what data to display. It ends up looking something like this:_DataBoundGrid.GridBoundColumns(1).MappingName = "StripDate". When the mapped properties are declared Public, it works. When the mapped properties are declared Friend, the grid is populated with the correct number of rows, but every cell is empty.

As a follow-up question, is it a good idea to avoid things, such as this Syncfusion binding method, which require me to pass property names as strings? It just feels as if I'm inviting trouble.

View 1 Replies

Access A Variable From One Class And Use In Another?

Mar 4, 2012

I want to do this: [URL] but in VB. I believe that is for C# I have 2 classes.

[Code]....

I know I've been asking too many questions lately and I do apologise for that. I am trying to learn the basics

View 12 Replies

Access Class From Inherited?

Oct 14, 2011

I have two classes[code]...

How can I modify class1 in a sub in class2?

View 2 Replies

Access Property In A Class?

Aug 27, 2011

Private _Order As Order() Public Property Order() As Order() Get Return _Order End Get Set(ByVal value As Order()) _Order = value End Set End Property

I need to get property name 'color' inside the 'order()' array, i am trying ' Order.color ' but its not getting,

View 4 Replies

Access The Variable From Another Class

Dec 1, 2011

how to access the variable from another [Code] I need to call the variable invoiceno in the class xmlserializer using ord1 and assign the value which the user enters during the runtime.

View 6 Replies

Can't Access Form1 From Another Class

Oct 18, 2011

I have a class called class1, in that class i wan;t to write something in a textbox in form1, but it won't let me access Form1.TextBox1.text, another problem is that it won't give me the save dialog in excel, but thats another problem.How can i acces Form1 controls?

Form1 code

Public Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Call ThisDrawing.GetFilepath(True)
If Me.TextBox1.Text = "" Or Me.TextBox1.Text = "False" Then MsgBox("Er is geen geldige filenaam opgegeven")
End Sub

[code]....

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved