|
-
Sep 29th, 2007, 02:20 PM
#1
Thread Starter
Hyperactive Member
[2005] Problem with opening / closing connections
Hello,
I have a bit of a problem with my application in as much as when I open it and it connects to the SQL Server DB, instead of opening just 1 process in SQL Enterprise Manager it opens about 10.
This means I obviously am opening connections and not closing them.
The trouble is, I didn't create the code so I don't know where to put this right.
If I can give you an idea of how the app works, I'm hoping maybe someone can help me?
It is a 3 tier application, with an app layer, a data layer and a web service layer.
When you log in, it connects to the Web Service layer and brings back user information. (See code below)
Code:
UserID = txtEERef.Text
ds = New DataSet
ds = Users.GetUserInfo(txtEERef.Text)
If ds.Tables(0).Rows.Count > 0 Then
If UCase(txtPassword.Text) <> UCase(ds.Tables(0).Rows(0).Item("Password".ToString)) Then
MessageBox.Show("Invalid Password", "Login Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
Authorised = False
txtPassword.SelectAll()
txtPassword.Clear()
txtPassword.Focus()
Exit Sub
End If
Else
MessageBox.Show("You are not in the List of Users for the Database." & vbNewLine & vbNewLine & "Please see your Administrator for this Application.", "Login Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
Authorised = False
txtEERef.SelectAll()
txtEERef.Clear()
txtEERef.Focus()
Exit Sub
End If
UserAccessLevel = ds.Tables(0).Rows(0).Item("AccessLevel".ToString)
UserID = ds.Tables(0).Rows(0).Item("EmployeeNumber".ToString)
ds = EEList.Populate_Personal_Details(UserID)
If ds.Tables(0).Rows.Count > 0 Then
UserName = ds.Tables(0).Rows(0).Item("FullName".ToString)
Else
MessageBox.Show("You do not have an Employee Record in the Database" & vbNewLine & vbNewLine & "You must have your Administrator set up an Employee Record for you.", "No Employee Record Found.", MessageBoxButtons.OK, MessageBoxIcon.Error)
Authorised = False
Exit Sub
End If
ds.Dispose()
Users.Dispose()
EEList.Dispose()
Authorised = True
Users.UpdateLoggedInDate(UserID, Date.Today)
Me.Update()
Me.Close()
This alone creates about 10 processes in Enterprise Manager.
Obviously for anyone to help me they would need more information / code, but to be honest I'm not sure exactly what code will help the most - therefore if anyone can help me, it would great if they could let me know what code they would need to see in order to help me with my problem.
Thanks,
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|