Department<br />
<asp:DropDownList ID="DeptDrop_1" runat="server"
DataSourceID="SqlDataSource_VMFG1" DataTextField="ID" DataValueField="ID">
</asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource_VMFG1" runat="server"
ConnectionString="<%$ ConnectionStrings:VMFGConnectionString %>"
SelectCommand="SELECT [ID] FROM [DEPARTMENT]"></asp:SqlDataSource>
New at this, so be gentle. Basically what I'm trying to do is get the form to load a list of possible departments for a given employee directly from our ERP database- so I can be sure it's up-to-date.
Visually the dropbox seems to work, it pulls the desired column and makes the choices available in the form.
But the real endgame here is to get the form contents to post to a text file, and for whatever reason (probably how I declared it in the code-behind) it won't post the content of the dropbox to the container file.
It just leaves a blank.
Here's the codebehind (it's been suggested I post more of it- apologies if much of it ins't relavent):
Protected Sub SUBMIT_1_Click(sender As Object, e As EventArgs) Handles SUBMIT_1.Click
Dim Message As String = ""
Dim Emp_Name As String = ""
Dim Emp_ID As String = ""
Dim DTPick_TI As String = ""
Dim DTPick_TO As String = ""
Dim TypeDropList1 As String = ""
Dim Department As String = ""
Dim LdmSup_1 As String = ""
Dim AdjReason_1 As String = ""
Department = DeptDrop_1.SelectedItem.Value
Dim fso
Dim tst
fso = Server.CreateObject("Scripting.FileSystemObject")
tst = fso.OpenTextFile("C:\Users\01853\Documents\Visual Studio 2010\Projects\IntranetForms2\IntranetForms2\Output\reading.txt", 2)
tst.writeline("Emp_Name = " & Request.Form("Emp_Name"))
tst.writeline("Emp_ID = " & Request.Form("Emp_ID"))
tst.writeline("Time_In = " & Request.Form("DTPick_TI"))
tst.writeline("Time_Out = " & Request.Form("DTPick_TO"))
tst.writeline("Type of Correction = " & Request.Form("TypeDropList1"))
tst.writeline("Department = " & Request.Form("Department"))
tst.writeline("Leadman/Supervisor = " & Request.Form("LdmSup_1"))
tst.writeline("Reason/Comment = " & Request.Form("AdjReason_1"))
tst.close()
tst = Nothing
fso = Nothing
Message = "Your Clock Adjustment Request has been sent to Human Resources. Thank you."
Notify_1.Text = Message
End Sub
This is probably a pretty obvious answer, but I'm having an issue finding an answer at all (likely I don't know enough of the lingo to search effectively).