preethishivbaba 0 Newbie Poster

Hi all,

I have an urgent problem..Plzz can anyone help me guys..

We are into a student management system project and we want to send E-mails to students once tehy are registered with us saying taht from so and so date teh course is gonna start.

I am getting teh following error.

Actually our server is connected to a Fileserver and tehn then exchange server.

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
If CType(Session("CurUserProfile"), Avantus.WebModules.SystemAdmin.Business.UserMgmt).ADUserID = "" And _
CType(Session("CurUserProfile"), Avantus.WebModules.SystemAdmin.Business.UserMgmt).LDAP = "" Then
Session("Error") = "<B><h3>Access To Avantus Training Management System Denied!</h3><BR><h5>You Need To Have A User Profile To Logon To The System.<BR>Contact Your Administrator For More Information.</h5></B>"
Session("Hide") = True
Session("CurUserProfile") = Nothing
Response.Redirect("../SystemAdmin/Error.aspx")
ElseIf Not (CType(Session("CurUserProfile"), Avantus.WebModules.SystemAdmin.Business.UserMgmt).Profile_LogOnTimingFrom = "" And _
CType(Session("CurUserProfile"), Avantus.WebModules.SystemAdmin.Business.UserMgmt).Profile_LogOnTimingTo = "") Then
If Not ((DateTime.Parse(Now.ToShortDateString & " " & CType(Session("CurUserProfile"), Avantus.WebModules.SystemAdmin.Business.UserMgmt).Profile_LogOnTimingFrom) <= Now) And _
(DateTime.Parse(Now.ToShortDateString & " " & CType(Session("CurUserProfile"), Avantus.WebModules.SystemAdmin.Business.UserMgmt).Profile_LogOnTimingTo) >= Now)) Then
Session("Error") = "<B><h3>Access To Avantus Training Management System Denied!</h3><BR><h5>You Are Restricted To Log On At This Time.<BR>Contact Your Administrator For More Information.</h5></B>"
Session("Hide") = True
Session("CurUserProfile") = Nothing
Response.Redirect("../SystemAdmin/Error.aspx")
End If
ElseIf Not CType(Session("CurUserProfile"), Avantus.WebModules.SystemAdmin.Business.UserMgmt). _
TrainingAdmin_myReminderConfirm_View Then
Session("Error") = "<B><h3>You Do Not Have Access Privileges!</h3><BR><h5>Contact Your Administrator For More Information.<br><h6><a href='../../index.aspx'>Back To Home</a></h6></h5></B>"
Session("Hide") = True
Response.Redirect("../SystemAdmin/Error.aspx")
Exit Sub
End If
MenuNav1.SourceFilePath = "../../Config/NavMenu.xml"
MenuNav1.ver = Version()
MenuNav1.displayName = CType(Session("displayName"), String)
If Not Page.IsPostBack Then
LoadConfirmStudent()
End If
If Not CType(Session("CurUserProfile"), Avantus.WebModules.SystemAdmin.Business.UserMgmt). _
TrainingAdmin_myReminderConfirm_Print Then
TDReportGenHeader.Visible = False
TDReportGenSettings.Visible = False
dgStudent.Columns(7).Visible = False
End If
End Sub
Public Sub LoadConfirmStudent()
Dim myTrainingAdmin As New Avantus.WebModules.TrainingAdmin.Business.ReportGen
dgStudent.DataSource = myTrainingAdmin.GetAllConfirmStudent()
dgStudent.DataBind()
myTrainingAdmin = Nothing
End Sub
Private Sub dgStudent_SortCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridSortCommandEventArgs) Handles dgStudent.SortCommand
Dim myTrainingAdmin As New Avantus.WebModules.TrainingAdmin.Business.ReportGen
Dim myDataView As DataView = myTrainingAdmin.GetAllConfirmStudent().Tables(0).DefaultView
myDataView.Sort = e.SortExpression
dgStudent.DataSource = myDataView
dgStudent.DataBind()
myTrainingAdmin = Nothing
End Sub
Private Sub imgButGenerate_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles imgButGenerate.Click
Dim i As Integer = 0
Dim k As Integer = 0
Dim j As Integer = 0
Dim moreThanOne As Boolean = False
Dim sendToAddr As String = ""
Dim salesPerson As String = ""
Dim objHtml As String = ""
Dim myStudentAdmin As New Avantus.WebModules.Registration.Business.StudentAdmin
Dim myAD As New Avantus.WebModules.SystemAdmin.Business.ActiveDirectory
Dim myReportGen As New Avantus.WebModules.TrainingAdmin.Business.ReportGen
Dim regStudentID() As ArrayList
Dim regNo() As ArrayList
Dim lastRegNo As String = ""
Dim lastCourseRef As String = ""
Dim lastCourseDate As String = ""
Dim firstTimeEntered As Boolean = True
Try
For i = 0 To dgStudent.Items.Count - 1
If CType(dgStudent.Items(i).Cells(7).Controls(1), CheckBox).Checked Then
'if it is the same reg, same course, same date or 1st item
If (lastRegNo = "" And lastCourseRef = "" And lastCourseDate = "") _
Or (lastRegNo = dgStudent.Items(i).Cells(2).Text And _
lastCourseRef = dgStudent.Items(i).Cells(0).Text And _
lastCourseDate = dgStudent.Items(i).Cells(4).Text) Then
If k = 0 And firstTimeEntered Then
ReDim Preserve regStudentID(1)
ReDim Preserve regNo(1)
regStudentID(0) = New ArrayList
regNo(0) = New ArrayList
regStudentID(0).Add(Integer.Parse(Integer.Parse(dgStudent.Items(i).Cells(8).Text)))
regNo(0).Add(dgStudent.Items(i).Cells(2).Text)
firstTimeEntered = False
Else
regStudentID(k).Add(Integer.Parse(Integer.Parse(dgStudent.Items(i).Cells(8).Text)))
End If
Else
ReDim Preserve regStudentID(regStudentID.Length + 1)
ReDim Preserve regNo(regNo.Length + 1)
k += 1
regStudentID(k) = New ArrayList
regNo(k) = New ArrayList
regStudentID(k).Add(Integer.Parse(Integer.Parse(dgStudent.Items(i).Cells(8).Text)))
regNo(k).Add(dgStudent.Items(i).Cells(2).Text)
End If
lastRegNo = dgStudent.Items(i).Cells(2).Text
lastCourseRef = dgStudent.Items(i).Cells(0).Text
lastCourseDate = dgStudent.Items(i).Cells(4).Text
End If
Next
If rbFax.Checked Then
For j = 0 To k
If moreThanOne Then
objHtml = objHtml + "<DIV style='page-break-after:always'></DIV>"
End If
objHtml = objHtml + myReportGen.GenConfirmReminder(CType(regNo(j)(0), String), _
regStudentID(j), ddlType.SelectedValue, True, rtxt.GetHTMLText)(0)
If ddlType.SelectedValue = "CONFIRM" Then
myStudentAdmin.UpdateRegStudentConfirmLetter(regStudentID(j), Now.ToUniversalTime.AddHours(8).ToString)
ElseIf ddlType.SelectedValue = "REMIND" Then
myStudentAdmin.UpdateRegStudentRemindLetter(regStudentID(j), Now.ToUniversalTime.AddHours(8).ToString)
End If
moreThanOne = True
Next
Response.Output.Write(objHtml + "</BODY></HTML>")
Response.End()
Response.Clear()
objHtml = Nothing
myStudentAdmin = Nothing
myAD = Nothing
myReportGen = Nothing
Else
Dim str() As String = Nothing
Dim LetterType As String = ""
For j = 0 To k
If ddlType.SelectedValue = "CONFIRM" Then
LetterType = "Avantus Training: Course Confirmation Email"
ElseIf ddlType.SelectedValue = "REMIND" Then
LetterType = "Avantus Training: Course Reminder Email"
End If
str = myReportGen.GenConfirmReminder(CType(regNo(j)(0), String), _
regStudentID(j), ddlType.SelectedValue, False, rtxt.GetHTMLText)
If str.Length = 3 Then
objHtml = str(0)
sendToAddr = str(1)
salesPerson = str(2)
End If
myReportGen.EmailReport(GetAppSetting("Operations"), sendToAddr, _
GetAppSetting("Cc") + "," + myAD.GetEmail(salesPerson) + "," + _
myReportGen.GetStudentEmail(regStudentID(j)), _
LetterType, objHtml, CType(regStudentID(j)(0), Integer), _
ddlType.SelectedValue)
If ddlType.SelectedValue = "CONFIRM" Then
myStudentAdmin.UpdateRegStudentConfirmLetter(regStudentID(j), Now.ToUniversalTime.AddHours(8).ToString)
ElseIf ddlType.SelectedValue = "REMIND" Then
myStudentAdmin.UpdateRegStudentRemindLetter(regStudentID(j), Now.ToUniversalTime.AddHours(8).ToString)
End If
Next
Response.Redirect("../TrainingAdmin/CRLetterGen.aspx")
myReportGen = Nothing
str = Nothing
LetterType = Nothing
End If

Catch Ex As Exception
If ddlType.SelectedValue = "CONFIRM" Then
myStudentAdmin.UpdateRegStudentConfirmLetter(regStudentID(j), "-1")
ElseIf ddlType.SelectedValue = "REMIND" Then
myStudentAdmin.UpdateRegStudentRemindLetter(regStudentID(j), "-1")
End If
End Try

'If rbFax.Checked Then
' Try
' For i = 0 To dgStudent.Items.Count - 1
' If CType(dgStudent.Items(i).Cells(7).Controls(1), CheckBox).Checked Then
' If moreThanOne Then
' objHtml = objHtml + "<DIV style='page-break-after:always'></DIV>"
' End If
' objHtml = objHtml + myReportGen.GenConfirmReminder(dgStudent.Items(i).Cells(2).Text, _
' Integer.Parse(dgStudent.Items(i).Cells(8).Text), ddlType.SelectedValue, True)(0)
' If ddlType.SelectedValue = "CONFIRM" Then
' myStudentAdmin.UpdateRegStudentConfirmLetter(Integer.Parse(dgStudent.Items(i).Cells(8).Text), Now.ToUniversalTime.AddHours(8).ToString)
' ElseIf ddlType.SelectedValue = "REMIND" Then
' myStudentAdmin.UpdateRegStudentRemindLetter(Integer.Parse(dgStudent.Items(i).Cells(8).Text), Now.ToUniversalTime.AddHours(8).ToString)
' End If
' moreThanOne = True
' End If
' Next
' Response.Output.Write(objHtml + "</BODY></HTML>")
' Response.End()
' Response.Clear()
' objHtml = Nothing
' myStudentAdmin = Nothing
' myAD = Nothing
' myReportGen = Nothing
' Catch Ex As Exception
' If ddlType.SelectedValue = "CONFIRM" Then
' myStudentAdmin.UpdateRegStudentConfirmLetter(Integer.Parse(dgStudent.Items(i).Cells(8).Text), "-1")
' ElseIf ddlType.SelectedValue = "REMIND" Then
' myStudentAdmin.UpdateRegStudentRemindLetter(Integer.Parse(dgStudent.Items(i).Cells(8).Text), "-1")
' End If
' End Try
'Else
' Dim str() As String = Nothing
' Dim LetterType As String = ""
' For i = 0 To dgStudent.Items.Count - 1
' If CType(dgStudent.Items(i).Cells(7).Controls(1), CheckBox).Checked Then
' If ddlType.SelectedValue = "CONFIRM" Then
' LetterType = "Avantus Training: Course Confirmation Email"
' ElseIf ddlType.SelectedValue = "REMIND" Then
' LetterType = "Avantus Training: Course Reminder Email"
' End If
' str = myReportGen.GenConfirmReminder(dgStudent.Items(i).Cells(2).Text, _
' Integer.Parse(dgStudent.Items(i).Cells(8).Text), ddlType.SelectedValue, False)
' If str.Length = 3 Then
' objHtml = str(0)
' sendToAddr = str(1)
' salesPerson = str(2)
' End If
' myReportGen.EmailReport(myAD.GetEmail(salesPerson), myAD.GetEmail(salesPerson) + "," + sendToAddr, _
' GetAppSetting("Cc") + "," + _
' myReportGen.GetStudentEmail(Integer.Parse(dgStudent.Items(i).Cells(8).Text)), _
' LetterType, objHtml, Integer.Parse(dgStudent.Items(i).Cells(8).Text), _
' ddlType.SelectedValue)
' End If
' Next

myStudentAdmin = Nothing
myAD = Nothing
myReportGen = Nothing
End Sub
Private Sub dgStudent_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles dgStudent.ItemDataBound
If Not e.Item.Cells(5).Text = "Reminder" Then
If e.Item.Cells(5).Text = "0" Then
e.Item.Cells(5).Text = "-"
ElseIf e.Item.Cells(5).Text = "-1" Then
e.Item.Cells(5).Text = "ERROR"
Else
Try
e.Item.Cells(5).Text = Format(DateTime.Parse(e.Item.Cells(5).Text), "MM/dd/yyyy HH:mm:ss")
Catch ex As Exception
End Try
End If
End If
If Not e.Item.Cells(6).Text = "Confirmation" Then
If e.Item.Cells(6).Text = "0" Then
e.Item.Cells(6).Text = "-"
ElseIf e.Item.Cells(6).Text = "-1" Then
e.Item.Cells(6).Text = "ERROR"
Else
Try
e.Item.Cells(6).Text = Format(DateTime.Parse(e.Item.Cells(6).Text), "MM/dd/yyyy HH:mm:ss")
Catch ex As Exception
End Try
End If
End If
End Sub
End Class
End Namespace

Unable to write to output file 'C:\Inetpub\wwwroot\Avantus\AvantusTMSVB\WebModules\SystemAdmin\SystemAdmin.Data\obj\Debug\Avantus.WebModules.SystemAdmin.Data.dll': The process cannot access the file because it is being used by another process.

Exception Details: System.IO.FileLoadException: The located assembly's manifest definition with name 'Avantus.WebModules.SystemAdmin.Business' does not match the assembly reference.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Assembly Load Trace: The following information can be helpful to determine why the assembly 'Avantus.WebModules.SystemAdmin.Business' could not be loaded.

=== Pre-bind state information ===
LOG: DisplayName = Avantus.WebModules.SystemAdmin.Business, Version=1.0.2351.25165, Culture=neutral, PublicKeyToken=4406b671abe81c4b
(Fully-specified)
LOG: Appbase = file:///C:/Inetpub/wwwroot/Avantus/AvantusTMSVB
LOG: Initial PrivatePath = bin
Calling assembly : (Unknown).
===
LOG: Publisher policy file is not found.
LOG: No redirect found in host configuration file (C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\aspnet.config).
LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\config\machine.config.
LOG: Post-policy reference: Avantus.WebModules.SystemAdmin.Business, Version=1.0.2351.25165, Culture=neutral, PublicKeyToken=4406b671abe81c4b
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/avantustmsvb/37222a32/aa0864d9/Avantus.WebModules.SystemAdmin.Business.DLL.
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/avantustmsvb/37222a32/aa0864d9/Avantus.WebModules.SystemAdmin.Business/Avantus.WebModules.SystemAdmin.Business.DLL.
LOG: Attempting download of new URL file:///C:/Inetpub/wwwroot/Avantus/AvantusTMSVB/bin/Avantus.WebModules.SystemAdmin.Business.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Revision Number

Stack Trace:

[FileLoadException: The located assembly's manifest definition with name 'Avantus.WebModules.SystemAdmin.Business' does not match the assembly reference.]
Avantus.AvantusTMS.Web.Global.Session_Start(Object sender, EventArgs e) +0
System.Web.SessionState.SessionStateModule.RaiseOnStart(EventArgs e)
System.Web.SessionState.SessionStateModule.OnStart(EventArgs e)
System.Web.SessionState.SessionStateModule.CompleteAcquireState()
System.Web.SessionState.SessionStateModule.BeginAcquireState(Object source, EventArgs e, AsyncCallback cb, Object extraData)
System.Web.AsyncEventExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute()
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +173


--------------------------------------------------------------------------------