.net - Provide Access To This Custom DAL?
May 13, 2010
I'm writing a custom DAL (VB.NET) for an ordering system project. I'd like to explain how it is coded now, and receive some alternate ideas to make coding against the DAL easier/more readable. The DAL is part of an n-tier (not n-layer) application, where each tier is in it's own assembly/DLL.
The DAL consists of several classes that have specific behavior. For instance, there is an Order class that is responsible for retrieving and saving orders. Most of the classes have only two methods, a "Get" and a "Save," with multiple overloads for each. These classes are marked as Friend and are only visible to the DAL (which is in it's own assembly).
In most cases, the DAL returns what I will call a "Data Object." This object is a class that contains only data and validation, and is located in a common assembly that both the BLL and DAL can read.To provide public access to the DAL, I currently have a static (module) class that has many shared members. A simplified version looks something like this:
Public Class DAL
Private Sub New
End Sub
Public Shared Function GetOrder(OrderID as String) as OrderData
[code].....
This cleans it up a bit, but it leaves a lot of classes that only have references to other classes, which I don't like for some reason.Without resorting to passing DB specific instructions (like where clauses) from BLL to DAL, what is the best or most common practice for providing a single point of access for the DAL?
View 2 Replies
ADVERTISEMENT
Mar 30, 2010
How can I provide an error message if the user does not provide a value in my textbox. I found this example, but it doesn't work in my
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e_
As System.EventArgs) Handles Button1.Click
If TextBox1.Text = "" Then
[code]....
It says that Error Provider1 is not declared. How do I do this the right way?
View 4 Replies
Nov 6, 2009
What is the best way to provide strongly typed access to the session object? I am planning on turning on Option Strict, which is causing the compiler to complain about my lazy programming technique of directly accessing the session object:
Dim blah As Integer = Session("Blah")
My initial thought is to create a class that wraps the session and provides strongly typed properties for the information stored in the session. However, I cannot decide if the class should be a singleton, or instantiated on every use, or where the code should reside (i.e. within the web project or within a class library).
I'm leaning towards a singleton in my class library, but I don't know if that is the best solution, or if I am missing any other possibilities.
Proposed Solution:
Public Class SessionAccess
Public Shared Property Blah(ByVal session As HttpSessionState) As Integer
Get
[Code].....
View 2 Replies
Jun 22, 2012
I would like to give permission to use this project to say, 10 users. The following code is fine for a single user. How can I write conditional code to provide the access to other nine users?
Submit button
If txtUsername.Text <> "Mahajan" Or txtPassword.Text <> "mh745" Then
MsgBox "Access Denied! Either Username or Password is incorrect!", vbOKOnly + vbCritical, "Security Login"
txtUsername.Text = ""
txtPassword.Text = ""
[code]....
View 5 Replies
Mar 25, 2012
I am looking for some help in finding the best way to display a progress window for a module I am working on.I have a VB2008 app using an Access 2007 db. One of the MODULES in the Access db does a masterfile update and I want to show the user what is happening in process.
The VB2008 app calls the Access module to do all the work which is FAR FASTER than having VB2008 do all the work.The goal is to have a small window popup and display the progress. Once the process is done, close the window. How would you do this? Use a Access form? That works but it not clean looking at all. Is there something else that might work better?
Something like a msgbox that opens and can be updated while the process runs. Once the process is done, it can be closed. The user will not need to interact with this window - it's just to show the applications progress.
View 11 Replies
Aug 21, 2009
Provide URL in a toolstrip? I mean to URL that will be displayed as a link.
View 4 Replies
Jun 16, 2009
In my propertygrid having one custom property ..suppose some text is there in this item.i want user to allow only delete the item.nothing more like editing ,backspace nothing..only provide delete key option to this property item..
View 4 Replies
Aug 26, 2010
i have a problem and my project is stop now so i must solve this problem i have a listbox in my project and simple is; so this infos are irregular. i getting this infos with a loop into listbox. i want this infos be sub-bottom.
View 2 Replies
Mar 5, 2009
We build a class (i.e. Server) and create a LOAD method that loads a dataset with all the details of that object.We need all that information sometimes... but what about when we only need one piece of data from that object (i.e. webserviceUrl).Should we build classes with a bunch of scalar methods that get back single pieces of data as opposed to only getting ALL the data and then only taking what we need?It's a waste to get all the data when we dont always need all of it but it also will take longer to write the extra methods..
View 2 Replies
Nov 14, 2010
I want to provide a textbox in my windows forms application (in vb.net) that will be masked in time format and validate for time in 12hr format. It should also auto complete i.e if user enters 6 and clicks tab then it should make the text to 6:00 am.
View 3 Replies
Oct 18, 2009
I have a need to provide mouse coordinates and click details to the sub-classes of an application. The details are stored in a typed variable in the main class, as they are not processed when the event occurs.
What is the correct way of getting the classes to refer to variables in the parent class that instigated them? I realise this is not standard practise, but at this stage in the project I am converting code from a procedural language and need to do this as an intermediary step. Using the mouse events is also not possible, as this is a DirectX-oriented real-time program, and some things still have to be processed procedurally. They have to be stored via the event and then processed manually.
I may have dozens of instances of the classes, so distributing the mouse data every time it changes is not a good option. Ideally, the class should be able to retrieve the data when it needs it.
View 2 Replies
May 15, 2010
I created a new DataGridViewColumn type called DataGridViewGradeColumn.
Public Class DataGridViewGradeColumn
Inherits DataGridViewTextBoxColumn
Public Property AssignmentName As String
[code].....
View 1 Replies
Jul 28, 2010
Is there a efficient way to provide an Enumarable<SomeType> or a collection that implements INotifyCollectionChanged but that can only be changed from the inside of the providing class.
The following example shows what I mean, but has the disadvantage that the caller can cast the IEnumerable<SomeType> back and then manipulate my internal collection, what I really would dislike:
[Code]...
View 2 Replies
Jan 11, 2010
When I build my VB.NET 2008 Express Edition project I get the following error
The designer loader did not provide a root domponent but has not indicated why
I though this meant that I need to put my Acces mdb in the root folder of the project but that didn't help. why I'm getting this error? If I click on more information I get an message saying information not found.
View 2 Replies
Nov 23, 2010
I want to make a user control (name MultiSelect), which I will use for choosing items from huge list. For example I want to choose customers to make a view of their turnovers, so I will creat a new MultiSelect control which will contain a textbox (i canwrite starting letters) and a treeview (will list customers matching the first letters chosen in textbox).
View 7 Replies
Nov 12, 2011
creating a simple pong type game. want to provide human user option to choose from "rookie , Veteran, Allstar" as CPU AI skill.
Q1 - currently on form load game starts (I do not want) I want to present list of options first. Player Skill Level *See above.
Q2 - Want to provide an option for who gets the ball first CPU or Human
Q3 - Want to choose "Game to #" the user can set as the first to score x points wins.
View 6 Replies
Apr 30, 2009
I would like to provide an effective way for my VB.NET application to get registered automatically in a company with many computers. So the Enterprise Licence would kick in, but how to manage this?I was thinking each computer would connect to an intranet server where he would get the permission to register...C64
View 2 Replies
Sep 28, 2011
Is that possible to provide a combobox that each item has its own checkbox?I'm looking for built-in component that enables it. I remember it was possible on VB6 but can't find it in VB.NET 2008
View 5 Replies
Jul 27, 2011
I'm trying to create a installation setup for my VB.net application. I need to insert a custom action while setup is running. So I add a Checkbox Dialog box to my setup. And I add a dll to the setup installation to capture Before Install and After Install events. Those are works fine. But I cannot access my check box value in those events. [code]
View 2 Replies
Apr 20, 2010
I'm currently working on my VB.NET certification and I'm using Murach's Visual Basic 2008 for my class textbook. Chapter 16 of the text covers writing my own ADO.NET data access codes. The code I have included here is for two classes of the project:
frmAddModifyCustomerDB.vb is prewritten by murach for this assignment and CustomerDB.vb is included written in the book as my assignment to build but not prewritten for me in the solution. According to the assignment, frmAddModifyCustomerDB.vb should not be modified unless instructed by the book. The procedure in question is Private Sub btnAccept_Click on the line that reads: "If Not CustomerDB.UpdateCustomer(customer, newCustomer) Then".After copying the CustomerDB.vb class directly from the book the assignment stated that the database should update properly when using the UpdateCustomer function that is fired when the Accept button is clicked. Every time I tried to modify a customer when doing this I kept getting the Database Error message box and the changes would be canceled.
After playing with the code I changed the "If Not CustomerDB.UpdateCustomer(customer, newCustomer) Then" to check against the boolean return from CustomerDB.vb by inserting "= False". When the modified code reads "If Not CustomerDB.UpdateCustomer(customer,
newCustomer) = False Then" the application updates properly and does not fire any exceptions. I'm confused by this because the book specified that I should not need to modify the code for the Add/Modify form in order for this to work.
Public Class frmAddModifyCustomer
Public addCustomer As Boolean
Public customer As Customer
[code].....
View 3 Replies
Jun 27, 2009
I am looking for a best practice to provide users of my ecommerce website with a breadcrumb trail. Current Site Setup:
[Code]...
View 1 Replies
Feb 10, 2011
i have to find a string in an array. i am using array.indexof method to get the index of matched item. now problem is that indexof method comparison is case sensitive and i cannot restrict user to provide case sensitive string.[code]
View 3 Replies
Dec 6, 2011
I have a form named VBProject It has two TextBoxes and one custom control named MyControl which is created in another project.MyControl's project has a form inside, named Form3. When My control is loaded it needs to find all controls in my VBProject and add them into a listbox which is in Form3. Then Show the Form3. In the end ListView need to shows name and text of textboxes but it shows nothing. Here are my codes:
MyControl's Load_Event:
Dim i As Integer = 0
MessageBox.Show("Control Count:" + Me.Controls.Count.ToString)
For Each MyObject In Me.Controls
If TypeOf MyObject Is TextBox Then
[code]...
View 1 Replies
Mar 12, 2010
I have a client who wants his custom-written CRM to be able to access his sales people's emails so that, effectively, a history of email conversations between customer and salesperson is stored inside the CRM's database.
The CRM is written in VB 2008 and the database is SQL Server 2008. The only email these people use, in the shop and on the road, is GMAIL. Each sales person has their own GMAIL address. Thats how they operate.
If they're on the road and respond to a customer's email inquiry about a product, they would like that email conversation to be stored in a table in the database. I think thats the part I cant wrap my head around. How to get access to the email data (knowing the user id and password) and doing so from VB 2008
Update: A free or close to free solution would be preferred.
View 2 Replies
Jun 9, 2012
I have a custom class called "Time" with the following function, for determining if one Time equals another Time.
Public Shared Shadows Function Equals(ByVal Time1 As Time, ByVal Time2 As Time) As Boolean
Dim x(2) As Integer
x(0) = CInt(Time1.Hour)
x(1) = CInt(Time1.Minute)
[code].....
Access of shared member, constant member, enum member or nested type through an instance; qualifying expression will not be evaluated.I know it shouldn't do any harm, just let the compiler skip evaluation, but is it a way of getting rid of this warning?
View 6 Replies
Sep 25, 2009
I have reached a situation where it probably makes more sense to pass custom Update and Insert commands to a CommandBuilder. I see that this can be done, but I have not found an example of how. The problem that I run into is this: The CommandBuilder iterates through the rows calling the Update or Insert command as needed. Writing the SQL for those would require accessing the items in the row. How does the CommandBuilder insert the row fields into the SQL? If I were doing it myself, I would be doing something like:
For Each DR as Datarow in Datatable
which would allow me to access the items through the DR object. What does the CommandBuilder expose for custom SQL to access the items in the row?
View 8 Replies
Oct 6, 2009
I'm trying to build an app that will read custom properties set in an accdb file. Basically, I'm trying to build a Front End updater (Yes I know there are others already built, but they don't work the way I want). The Custom properties are initially set manually by pressing the Office button, going to Manage, then Database Properties and selecting the Custom tab.
I've got most of the code set up, but my sticking point is how to read the custom properties.
Following is the function I use within Access VBA to get the properties, but obviously this is not going to work in VB.Net.
[Code].....
I think I need to replace one or more of the 4 lines after the On Error (yes I know I need to change the Error trapping too). I'm guessing I need to connect to the database file (an accdb, btw) and then go from there to define the container and documents collections.
View 1 Replies
Sep 2, 2009
I have a winforms (VB 2008) based app that I'm developing and I want to use custom roles for user access.Application Layout:I have a Main form that opens a login form when certain actions occur.The Login form intern uses an authentication class that I've created, to authenticate users and set access rights.On my Applications settings page, I have Authentication Mode set to Application-defined because I cannot use Windows Authentication in the environment where this will be deployed.
The application uses a MS SQL 2005 db and the 3 tables I'm using in the authentication process are the User_Account , User_Roles and User_Access tables. The combination of an account in the User_Account and the roles within the User_Roles table are the bases for the User_Access table. Using the User_Access table is how I assign access to the various functions within the application
Authentication Method:To authenticate a user, I'm using the "My.User.CurrentPrincipal" (Code below) method. The My.User object works great and allows the use of "My.User.Name" property throughout the app when referring to the currently authenticated user.
Access Method:In order to set the current users access levels I'm using a function within my Authentication class and passing in My.User.Name as a variable. The function uses a Dataset Table Adaptor and a Select Case statement inside a For loop to assign all the access levels for the user (Function code below).
My Problem:This method of assigning access rights to a user does work but it's not persistent throughout the application as the My.User object is.I would like to find a way to create custom roles through the My.User object using its .IsInRole property. I would like to have these roles dynamically created using my User_Roles table.This would allow the custom roles to be used throughout my application using the My.User.IsInRole ("MyRole")syntax ...similar to how I'm currently able to use My.User.Name.Unfortunately the only roles I can currently validate against are the built in Windows
type accounts (Adminisrator ...ect.).
'User Authentication example:
If Authenticate.CheckPassword(tbxUserName.Text, strPassword) Then
My.User.CurrentPrincipal = New GenericPrincipal(New GenericIdentity(tbxUserName.Text), Nothing)[code].....
View 1 Replies
Jun 3, 2009
I M DEVELOPING AN ASP.NET APPLICATION I WANT TO PROVIDE INTERFACE IN ARABIC AND ENGLISH
View 2 Replies
Apr 1, 2009
In the .NET world, what application has replaced the role that SourceSafe used to provide in Visual Studio 6?
View 23 Replies