Database Access Pattern Code Review?

Nov 6, 2010

Anyone here kind enough to give me a code review on the following pattern that I have used for database access? I have provided one of the simpler datalayers to show the basic idea.In particular I am starting to question if using shared methods was a good idea and what problems may arise from that? Will this implementation fail in a threaded environment like ASP.Net?

Public Interface IFillable
Sub Fill(ByVal Datareader As Data.IDataReader)
End Interface

[code].....

View 1 Replies


ADVERTISEMENT

Asp.net - (3 Tierish) Database Access Pattern Code Review?

Jan 19, 2011

Anyone here kind enough to give me a code review on the following pattern that I have used for database access? I have provided one of the simpler datalayers to show the basic idea.In particular I am starting to question if using shared methods was a good idea and what problems may arise from that? Will this implementation fail in a threaded environment like ASP.Net?

[Code]...

View 1 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

VS 2008 Code Review (Control Making)

May 7, 2009

I downloaded this code from the web that Wierddemon gave me in my previous thread. This solution contains 2 projects (CurrencyControlTest and CurrencyTextBox) There are some things that I don't understand:

1. What's the type of form1.vb and program.vb in the CurrencyControlTest Project? Are they classes, or windows Forms or module?

2. This is the code in Program.vb

Imports Microsoft.VisualBasic
Imports System
Imports System.Collections.Generic

[CODE]...

What's the effect of <STAThread> code?

3. What is exactly the "Namespace" doing in this code? because when I removed the namespace, An error indicating that Form1 is not declared appeared. What is namespace? what does it do? Can anyone give sample code to emphasize the function and how and when to use the keyword "Namespace"?

4. This is code for Form1 in CurrencyControlTest Project

Imports Microsoft.VisualBasic
Imports System
Imports System.Collections.Generic

[CODE]...

What's with the "public partial class Form1"? what does "partial" do? When i right-clicked on the InitializeComponent(), A portion of code appeared suddenly with the header #Region. What is this? and when re-open the Form1 in "View Code" mode, they're gone.

View 7 Replies

.net - Code Review: Determining Whether A Folder Exists, Given The Full File Path?

Nov 30, 2009

With a function being passed a full path to a file, such as C:someFolderanotherFoldersomeXML.xml, determine whether the folder exists. Is there a smarter/better/more elegant way of doing this? Here is my implementation:

[code].....

View 2 Replies

C# - Speeding Up An Algorithm That Find Patterns In A Growing Collection - Code Review Beta - Stack Exchange?

Jun 25, 2012

I want to find a way to speed up this code.if you look at the condition of If calculated Then in the code below, this is what slowing down the code.While the code provided seem fast with Const initBit = 4 try it with something over 12.

I want to be able to use this code (with calculated param as True) with initBit of 20 or more.

Beware that 20 or more might require a gig or more of ram and/or compiled as x64.

C# code (converted with an online tool from VB.NET):

[Code]...

View 2 Replies

Example Code To Work To Access An Access Database Through Automation?

Oct 13, 2010

I have a similar problem posted in the forum similar to this : started learning VB. I am not able to get my example code to work to access an Access database through automation. The author of my book suggested that I might not have the correct Jet 4.0 engine. The specs I have are: MSJet40.dll, Dated 7/14/2009, Prod Ver 4.00.9756.0.

View 3 Replies

Code For Pattern Matching?

Apr 22, 2009

I have text like following example

XXZZXXXZXXZXXXXZZZZZZXVVVVVXZVZ

and also I have two patterns like XX and ZZ I want to find longest possible string which include above given two patterns and return starting and finishing index of the array.

View 3 Replies

Implement The Singleton Pattern For Access Via WCF?

Aug 17, 2010

I'd like to expose some functionality via a WCF service. I can configure WCF to instantiate a class per-request but am unsure how I can get a reference to a communal singleton if I were to have some functionality to store a list of calls to a method (call it LogMethod) via WCF in memory and return that list when the GetLogs method is called

I'm aware I could use a database/the file system to pass this data back an forth but in many cases, that seems to be overkill. Edit: It seems that nobody has a clear answer - I can't believe this is complex. Am I missing something obvious?

View 2 Replies

Pattern Matching Source Code?

Jun 10, 2011

I need A free source code for pattern matching(finger print matching) .

View 1 Replies

Access Database Instead Of Code?

Jan 14, 2012

I am using vb 2008 and this is a simple project to use split function to translate English language to Arabic but the problem with database it be in code (array) can anybody make this project use access database or other database instead of [code]...

View 1 Replies

Code To Access Database?

Mar 8, 2010

Doe anyone have a code that can be used for access database or were to put the code? In class they want us to use a Access program but we havnt taken a class on it. I have everything up and running so far but I want the information to transfer between the VB adn database and I am not getting to far.

View 1 Replies

C# - Better Pattern To Handle Nested Code Conditions?

Oct 28, 2010

I have a webpage that needs to selectively show or hide a substantial number of controls. Each control's visibility is determined based on which of 3 conditions are true.So, for example, given the conditions A, B, and C;

Control1 needs to be visible only when A and B are true and C is false.
Control2 needs to be visible only when B and C are true and A is false.
Control3 needs to be visible only when A and C are true and it doesn't care what B is.
and so on...

If each control looked at every condition, the control logic would be ugly, but doable.

[Code]...

View 2 Replies

What Type Of Code Should Put In The Controller In The MVC Design Pattern

Jul 7, 2009

In teh MVC design pattern, Controller is strongly related to the view (GUI). IN my application i need to generated a new BrandID, i used stored procedure to retreive the highest BrandID from teh DB (The model calls the stored procedure and sends the retreival value to the Controller), then in the controller increments the BrandID by "1" to create a new brand ID. SInce, controller is strogly related to "view", should i include this "brandID increment" part in teh controller or in the model classes?

View 3 Replies

Code For Updating A Access Database?

Apr 21, 2012

i am trying to update the info in my access database and i keep getting a syntax error. This is my first database program and i found a site online that showed my how to do it but when i get to the update it keeps giving me the syntax error.

Private Sub CreateBT_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CreateBT.Click
Dim con As New OleDb.OleDbConnection
Dim dbProvider As String

[code]....

View 1 Replies

How To Create A Access Database From VB Code

Nov 21, 2011

How can i create a Database file in Access 2010 file format (.accdb) and create tables in it through Vb code at runtime by taking the filename and table names from the user.PBL (Visual Studio 2010 Ultimate)

View 16 Replies

Code For Ms Access Database Connectivity With Program?

Feb 9, 2008

Send me code for ms access database connectivity using oledb and adodb using vb.net

View 5 Replies

Connect To Access 2010 Database Via Code

May 9, 2012

I am using VB 2010 Utimate on a Win7 64bit machine. I have an accdb database created through MS Access 2010 (database has a password). How do I go about connecting to it using codes without having to drag a database control on the form, also is it possible to code my form so that it will automatically detect the path of the accdb database? Also I want to view the whole table using datagrid view as well as perform database actions such as add, edit, del, save, search and etc.

View 7 Replies

Repair Access 2007 Database From Code?

Apr 26, 2012

I know that there is a topic about compacting and repairing but i already have the compact part done. I was wondering if there was any way to repair the database from code from within the database?

View 5 Replies

Take Screenshot And Save To Access Database In .net Code?

Feb 5, 2011

make a program in VB.net Ultimate 2010 that will take screenshot of the current desktop and save it to MS Access Database 2000 in a single click of button.

The challenge is the form. Form must be hide first before taking the screenshot so it will capture only the current desktop. After that, it will automatically saved to the MS Access database 2000. I hope someone can help me out of this stuff.

View 4 Replies

VS 2010 Creating A Access Database With Vb Code?

Jan 8, 2012

The following code creates a database ok. The issue I'm having is how to set the ID column to a Primary Key and AutoNumber. I have goggled it but haven't found anything that worked.

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Try

[Code]....

View 3 Replies

Design Pattern For Database Interaction?

Mar 12, 2012

I've been studying design patterns off-and-on now for a project I've recently been working on. I've been fortunate with this last one not to have to work with databases, but will soon have an opportunity.

View 8 Replies

2010 Access And Change Information In A Database With Only Code?

Jun 15, 2010

First, I would like to add a text box search field to this form (because navigating through several thousand users with arrows isn't going to work). When the search button is pressed, I want the username to be looked for. If found, the form (and each textbox, option button, etc.) is updated with that user. I can then modify the user's information and press save.

Second, how do I access and change information in a database with only code? For example, if I periodically want to check every user in the database to see if they have over "100 points" and if they do, I subtract 10 points from that user.

View 7 Replies

Application Code Affecting Access Database Data?

Sep 21, 2010

I have an application half built which accesses a Access (2003)Database File. From within the application I am able to change the data in the Access File using a Data Grid. The changes to the Data File are saved and can be recalled, changed or otherwisemanipulated however, when I add too or change any of the applicationcode the Access file reverts back to it's original state losing any data or changes that has been made.

View 3 Replies

IDE :: Get Primary Key Like Code For .net Form While Access Database Connected To It?

Apr 9, 2010

when i will enter form no. in the text box this should check the on the lost focus event either this form no. is already exsist or not.if exist show msgbox?

View 1 Replies

Image Insertion Source Code To Ms-access Database

Jun 22, 2010

In visual studio 2008.i want clear information to work..

View 2 Replies

LinkButton Vs Button VB Code For Access Database Update?

Nov 21, 2009

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
GRName = TextBox1.Text

[code]....

View 12 Replies

Macro Code To Import Table From Another Access Database?

Aug 31, 2009

I am creating a MS Access database. The database will import a table from another Access database, query for selected data within a date range. Thus, I am having difficulty with the Macro code to import the initial table. Therefore, what's the code to import a table from another access database? The database is names InputContract.mdb.

View 2 Replies

Writing The Code To Connect To The Access Database And Insert The New Row?

Sep 24, 2009

I am creating a form which has the customer information entered by the user.When the user clicks submit the row need to be inserted into table "customer".writing the code to connect to the access database and insert the new row?

View 3 Replies

Change Of Code If Database Is Changed (form Access To SQL Server)

Nov 10, 2010

I am trying to migrate from Access Database to SQL server database. Do I need to make changes (for saving, reading, deleting etc. data) to my code as well?

I understand I need to change connection but what about code?

View 2 Replies







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