|
I've been doing alot of research but coming up dry on strategies for implementing business rules and data access. Microsoft's patterns and practices documentation suggests seperating the actual data logic from the business class. For example, I have the following class:
Public Class TimeEntry
Private _EntryID as Integer
Private _StartTime as DateTime
Private _EndTime as DateTime
' Methods and properties to work with and expose private members
Public Sub Save()
' Save this time entry object depending on the current state of
' the application
End Sub
End Class
I want to be able to save this class either in a database (when in a connected environment) or to a data cache (xml or binary files). I am using the Data Access Application Block for SQL. However, I need the ability to connect to the database and create and update a TimeEntry object in any of the following ways:
1) Web services (for offsite connection to the database)
2) SQL Client (when onsite and connected to the local resources)
3) Data Caching/XML (when offsite and disconnected from any network)
Can anyone suggest books or articles that can introduce this concept? I have been developing primarily thin or rich clients. This is the first time I have looked into a smart client development project so I am having a difficult time grasping these concepts from MSDN.
Thanks!
|
|
|
|
|
|
|
Your specific question was about how to decouple your objects from the method used to persist them (database, web service, etc). This can be achieved in many ways, so I am uncomfortable recommending a specific approach without knowing more about your environment.
The books I mentioned (esp. P of EAA) cover the subject in detail, but they are not light reading, so I am not sure that they would help.
There are some articles on this site, in the Design and Strategy section that may help.
If you can find a good systems architect, that would probably be your best bet.
my blog
|
|
|
|
|
Hi
I have the following vb script that will query a AD group and then output the member of this group to a file. The output include the users logonname but I would also like to add the email address.
Does anyone know how to get this info?
Thanks
Andrew
>>>>>>>
Option Explicit
Dim Group, count
Dim GroupName
Dim GroupDomain
Dim Member
Dim txt
Dim oFileSys, strCurrDir, strDefaultNamingContext, oRoot, objUser
Set oFileSys = WScript.CreateObject("Scripting.FileSystemObject")
strCurrDir = oFileSys.GetAbsolutePathName(".")
' ******************************************
' Edit This for your Environment!
' ******************************************
GroupDomain = "TEST"
' ******************************************
' Find our default naming context...
Set oRoot = GetObject("LDAP://rootDSE")
strDefaultNamingContext = oRoot.get("defaultNamingContext")
Set oRoot = Nothing
GroupName = InputBox ("Group Name to list Members: ", "Enter Group Name")
If GroupName = "" Then
MsgBox("Must enter a group name!")
WScript.quit(1)
End If
Set oFileSys = CreateObject ("Scripting.FileSystemObject")
Set txt = oFileSys.OpenTextFile (strCurrDir & "\" & GroupName & " members.txt", 8, True)
Set Group = GetObject("WinNT://" & GroupDomain & "/" & GroupName & ",group")
count = 0
For Each Member in Group.Members
WScript.Echo "Finding Username " & Member.Name
On Error Resume next
Err.Clear()
Set objUser = GetObject(getLdapUN(Member.Name))
If Err<>0 Then
WScript.Echo "Error getting information for: " & Member.Name
txt.WriteLine Member.Name & vbtab & "Error - No Rights" & vbtab & "Error - No Rights"
Else
WScript.Echo "Description: " & objUser.description
WScript.Echo "Office: " & objUser.physicalDeliveryOfficeName
txt.WriteLine Member.Name & vbtab & objUser.description & vbtab & objUser.physicalDeliveryOfficeName
End if
count = count + 1
Next
WScript.Echo vbcrlf
WScript.Echo "A total of " & count & " accounts are members of the " & GroupName & " group."
WScript.Echo vbcrlf
WScript.Echo "Text file " & strCurrDir & "\" & GroupName & " members.txt" & " contains the list of users in this group."
' *************************************************
' Functions and Subroutines
' *************************************************
Function getLdapUN(strUN)
Dim oConnect, Command, strLdapQuery, Rs
getLdapUN = False
Set oConnect = CreateObject("ADODB.Connection")
Set Command = CreateObject("ADODB.Command")
'--- search for object in AD ---
strldapquery = "<ldap: "="" &="" strdefaultnamingcontext="">;" & _
"(&(objectCategory=person)(objectClass=user)(SamAccountName=" & _
strUN & "));ADsPath,cn;subtree"
oConnect.Provider = "ADsDSOObject"
oConnect.Open "Active Directory Provider"
Set Command.ActiveConnection = oConnect
Command.CommandText = strldapquery 'strSQL
Set Rs = Command.Execute 'Execute the query
'WScript.Echo "Records: " & Rs.RecordCount
If Rs.RecordCount > 0 Then
getLdapUN = rs("AdsPath")
End If
Set oConnect = Nothing
Set Command = Nothing
End Function
'~~[/script]~~
|
|
|
|
|
Exchange Server Distribution Lists, LDAP and WSH
http://rtfm.atrax.co.uk/infinitemonkeys/articles/wsh/988.asp
|
|
|
|
|
Me again!
I was wondering if anyone knew how to send a command to print a PDF file without necessarily opening it. What I want to do is print a list of PDFs when i use a button event. So my list of PDF files will be in an array, and i can just print them off one by one to my printer. It would be nice to do this in a command line or something but i cant figure out how. any ideas??? thanks for all your help with my questions lately!
megadith
|
|
|
|
|
The command line for launching Acrobat Reader and telling it to print a .PDF file is:
AcroRd32.exe /p /h "%1"
Where %1 should be replaced by the full path to the file you want to print.
All you need to do is Shell launch that command line and you'll get your PDF's printed.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I'm looking for a method to determine from a VB6 application if the current user is connected using Terminal Services.
Thanks for any pointers.
|
|
|
|
|
You'll have to call the GetSystemMetrics Win32 API function to get this information.
Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long
Private Const SM_REMOTESESSION As Long = &H1000
Dim rc As Long
rc = GetSystemMetrics( SM_REMOTESESSION )
If rc <> 0 Then
' This session is running on Terminal Services.
Else
' This session is NOT running on Terminal Services.
End If
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
How can I create an ISS file to be used for silent installation when distributing an application?
|
|
|
|
|
I though ISS file were for automating the installation of SQL Server and various services, not the creation of a database. I've just always used a SQL script to create the database on whatever server the user specifies.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Well, I am lost here and I need help!
I need to create a file for silent installation for an application-created using VB.Net- that is going to be distributed via a network.
This can be done by an ISS file..But I have no idea how
Any suggestions?
|
|
|
|
|
I don't know how an ISS file is going to come into play, because I've never used one for any installation, even a quite one.
If your app installation was built with the Visual Studio Installer and you created an .MSI file that contains your installation, you can launch it without any user interface, otherwise known as quiet mode, just by including the /quiet (or /q) command line switch. The command line to launch your install would look something like this:
msiexec /package myApp.msi /quiet
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i need to retrieve all object from a project
the project is an acces database adp or mdb or ade
iwant to show all objects name with out opening the project
i need help about opening a mdb acces file
shay dayan
shay@amitec-g.com
shayperi@012.net.il
|
|
|
|
|
I have a dataview bound to a windows form datagrid. I wish to ensure that data is entered in a column (say 0) before other columns can be modified. When no text is entered in the column, the columnchanging event is not fired. How do you get this event to fire as long as that column has received focus and is now losing it?
I also tried putting the datagrid in the edit mode but it didn't work. Any ideas?
Thanks
|
|
|
|
|
If I want to print only 5 - 10 records, Can I perform Mail Merge to Printer.
What would be easy way to do so.
Thanks
|
|
|
|
|
What do you mean by "to Printer"?
Are you trying to do this in code or in Word?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have Templates setup in Word. My program updates the SQL database and then it should print the templates. There is a Mail Merge in word document to the Database. Now If i want to print only 5 records instead of printing all records, It should perform Merge to Printer (same as in word). I want to create a program with From, To, Current, All which will allow me print records in the templates.
In the word there are features as "Merge to New Document", "Merge to Printer", "Merge to Email"
Thanks for replying.
|
|
|
|
|
You might want to look at How To Automate Microsoft Word to Perform a Mail Merge from Visual Basic .NET[^] on MSDN. Get the MailMerge to work how you want first, then worry about hiding Word.
When you get down to the bottom of the code, change the line
wrdMailMerge.Destination = Word.WdMailMergeDestination.wdSendToNewDocument
to read
wrdMailMerge.Destination = Word.WdMailMergeDestination.wdSendToPrinter
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
i want to Synchronize my local database with remote database but i have to face problem in login
i m writing my connection string here, it opens the database but when i want to retrieve database, it gives me error login failed computername/guest
while my login name is not guest.....i have no account with the name guest.
/*************************************************************************/
Private Sub btnButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnButton2.Click
'Dim flag As Boolean = Me.ChkValidIP(Me.txtTextBox2.Text)
'If flag = True Then
Dim CS As String = "Network Library=DBMSSOCN;" & _
"Data Source=10.0.0.15,1433;" & _
"Initial Catalog=REIMSCDB;" & _
"User ID=sa;" & _
"Password= ;" & _
"Trusted_Connection=yes;"
Dim con As SqlConnection = New SqlConnection(CS)
Try
If con.State.Open Then
Dim sqlDA As SqlDataAdapter = New SqlDataAdapter("SELECT * FROM LoginAccount", con)
Dim ds As DataSet = New DataSet
sqlDA.Fill(ds)
If Not ds Is Nothing Then
Dim dr As DataRow = ds.Tables(0).Rows(0)
MessageBox.Show(Convert.ToString(dr("LoginID")))
End If
MessageBox.Show("Done")
con.Close()
Else
MessageBox.Show("false")
End If
Catch oexp As System.Data.SqlClient.SqlException
MessageBox.Show(oexp.Message)
Finally
con.Close()
End Try
'End If
/*************************************************************************/
please try this code and send me solution if you know about this.
RAK
|
|
|
|
|
Try switching the Trusted_Connection=yes to Trusted_Connection=no . And please, please use a login id other than sa.
my blog
|
|
|
|
|
i tried all posibilities of login but it don't work send me another solution of it
|
|
|
|
|
i need a combo box just like use in
OutLook express--->
Contacts--->
New Contact ---->
Email : Combo box Diaplay
Please open the outlook express and see the new contacts if you know help me
RAK
|
|
|
|