In Default aspx. I have
<table style="width: 100%">
<tr>
<td>
<b>Nurses/Tech Name: </b> <span>
<asp:dropDownList ID="Nurses" runat="server" CssClass="dropDownList" DataValueField="NursesTable">
</asp:dropDownList>
</span>
</td>
<td>
<b>Department:<asp:DropDownList ID="departmentTextBox" runat="server">
<asp:ListItem>DHR Surgery</asp:ListItem><asp:ListItem>WHR Surgery</asp:ListItem><asp:ListItem>CVOR</asp:ListItem><asp:ListItem>Cath Lab</asp:ListItem><asp:ListItem>Radiology</asp:ListItem><asp:ListItem>Endoscopy</asp:ListItem></asp:DropDownList></b>
</td>
</tr>
<tr>
<td>
<b>Physician's Name:</b>
<asp:dropdownlist ID="Physician" runat="server" DataValueField="DoctorTable">
</asp:dropdownlist>
</td>
<td>
<b>Visit ID:<asp:TextBox ID="VisitID" runat="server" ></asp:TextBox>
</b>
</td>
</tr>
<tr>
<td>
<b>Procedure:</b>
<span class="dropDownList">
<asp:textbox ID="procedureTextBox" runat="server" Width="300px"></asp:textbox>
</span>
</td>
<td>
<b>Date:</b>
<asp:Label ID="dateLabel" runat="server" CssClass="dateFont"></asp:Label>
</td>
</tr>
</table>
In Default.aspx.cs I have
protected void Submit_Click(object sender, EventArgs e)
{
SqlConnection conn = new
// Omitted for security in EE
SqlCommand cmd = new SqlCommand("AddData", conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@userID", authUserName);
cmd.Parameters.AddWithValue("@nurseName", Nurses.Text.ToString());
cmd.Parameters.AddWithValue("@physicianName",Physician.Text.ToString());
cmd.Parameters.AddWithValue("@visitID", VisitID.Text);
cmd.Parameters.AddWithValue("@department", departmentTextBox.Text);
cmd.Parameters.AddWithValue("@procedure", procedureTextBox.Text);
cmd.Parameters.AddWithValue("@date", dateLabel.Text);
cmd.Parameters.AddWithValue("@question1", RadioButtonList1.SelectedValue);
cmd.Parameters.AddWithValue("@question2", RadioButtonList2.SelectedValue);
cmd.Parameters.AddWithValue("@question3", RadioButtonList3.SelectedValue);
cmd.Parameters.AddWithValue("@question4", RadioButtonList4.SelectedValue);
cmd.Parameters.AddWithValue("@question5", RadioButtonList5.SelectedValue);
cmd.Parameters.AddWithValue("@question6", RadioButtonList6.SelectedValue);
cmd.Parameters.AddWithValue("@question7", RadioButtonList7.SelectedValue);
cmd.Parameters.AddWithValue("@question8", RadioButtonList8.SelectedValue);
cmd.Parameters.AddWithValue("@question9", RadioButtonList9.SelectedValue);
//OPENING Connection
conn.Open();
cmd.ExecuteNonQuery();
//END Database Connection
conn.Close();
// Sends user to redirect page
Response.Redirect(Submit.CommandArgument.ToString());
Reset();
}
|