title: Compare textbox to sql database, insert sql command
body: <p>I am using Visual Web Developer 2010 to create a "project" for school. It is pretty simple.</p>
  
  <p>The idea is for a patient self-check-in kiosk for a medical facility. </p>
  
  <p>I already have my sql database created with the following:</p>
  
  <pre><code>Table: Doctors
  Fields: Doctor_ID (PK), Doctor_F_Name, Doctor_L_Name
  
  Table: Patients
  Fields: Patient_ID (PK), Patient_F_Name, Patient_L_Name
  
  Table: Appointments
  Fields: Appointment_ID (PK), Appt_Day, Appt_Mo, Appt_Yr, Patient_ID (SK), Doctor_ID (SK), Appt_Time, Appt_Reason, Checked_In
  </code></pre>
  
  <p>So the first page of the code has a simple layout with 3 text entry boxes asking for the patients first name, last name, and last 4 of SSN (<code>Patient_ID</code>) and a submit button. </p>
  
  <p>I would like for the data from the text boxes to be used to compare to the database and ask the question "are you here to check-in for your appointment today at (<code>Appt_Time</code>) with (Dr. <code>Doctor_L_Name</code>) for (<code>Appt_Reason</code>)?) and then a check box or drop down for yes or no, if yes is chosen then it inserts a "1" (<code>binary</code>) into checked_in field </p>
  
  <p>I have gotten the text boxes and button created:</p>
  
  <pre><code>&lt;script runat="server"&gt;
  sub submit (sender as object, e as eventargs)
  lbl1.text= "Hello, " &amp; Textbox1.text &amp;" " &amp; Textbox2.Text
  end sub
  &lt;/script&gt;
  
  &lt;h2&gt; First Name &lt;/h2&gt;
  &lt;asp:textbox id=Textbox1" runat"server" /&gt;
  &lt;h2&gt; Last Name &lt;/h2&gt;
  &lt;asp:textbox id=Textbox2" runat"server" /&gt;
  &lt;h2&gt; Last 4 of SSN &lt;/h2&gt;
  &lt;asp:textbox id=Textbox3" runat"server" /&gt;
  &lt;asp:button: ID="Button1" onclick="submit" runat="server" text="submit" /&gt;
  &lt;asp::label id="lbl1" runat="server" /&gt;
  </code></pre>
  
  <p>Below this I have a few debug checks to make sure communication with the sql server is working, and I can pull table information into a gridview without issue using the following connection settings:</p>
  
  <pre><code>&lt;asp:sqldatasource id="sqldatasource3" runat="server" connectionstring="&lt;%$ connectionstrings:PB_MedicalConnectionString %&gt;"
  selectcommand="select * from [Patients]" /&gt;
  </code></pre>
  
  <p>Then running a gridview:</p>
  
  <pre><code>&lt;asp:gridview id="gridview1" runat="server" datakeyNames="Patient_ID" Datasource="sqldatasource3"&gt;
  &lt;columns&gt;
  &lt;asp:boundfield datafield="Patient_ID" HeaderText="Patient_ID" ReadOnly="True" SortExpression=""Patient_ID" /&gt;
  &lt;asp:boundfield datafield="Patient_F_Name" HeaderText="Patient_F_Name" ReadOnly="True" SortExpression=""Patient_F_Name" /&gt;
  &lt;asp:boundfield datafield="Patient_L_Name" HeaderText="Patient_L_Name" ReadOnly="True" SortExpression=""Patient_L_Name" /&gt;
  &lt;/columns&gt;
  &lt;//asp:gridview&gt;
  </code></pre>
  
  <p>This successfully returns the "patients" already entered into the database.</p>
  
  <p>Any help creating/finishing this would be great. I am getting very tired of searching for tips, trying, failing searching, trying, failing..... </p>
  
  <p>Thanks,
  Eric</p>