2013-05-29 5 views
0

Код для моей модальной таблицы, которая должна быть помещена в базу данных sql. Мне нужно, чтобы эти текстовые поля были помещены в мою базу данных, но я не уверен, что это касается сантехники. Мне просто нужны текстовые поля из этого модального файла для импорта данных в мою базу данных.Данные из текстовых полей в базу данных sql

<div id="AddInfo" style="display: none;"> 
     <table> 
      <tr> 
       <td> 
        <asp:Label ID="lblId" runat="server" Text="ID" Height="16px" Width="135px"></asp:Label> 
        <asp:Label ID="lblLastName" runat="server" Text="Last Name" Height="16px" Width="129px"></asp:Label> 
        <asp:Label ID="lblFirstName" runat="server" Text="First Name" Height="16px" Width="134px"></asp:Label> 
        <asp:Label ID="lblMiddleName" runat="server" Text="Middle Name" Height="16px" Width="131px"></asp:Label> 
       </td> 
      </tr> 
      <tr> 
       <td> 
        <asp:TextBox ID="tbID" runat="server" Height="16px" Width="125px"></asp:TextBox> 
        <asp:TextBox ID="tbLastName" runat="server" Height="16px" Width="125px"></asp:TextBox> 
        <asp:TextBox ID="tbFirstName" runat="server" Height="16px" Width="125px"></asp:TextBox> 
        <asp:TextBox ID="tbMiddleName" runat="server" Height="16px" Width="125px"></asp:TextBox> 
       </td> 
      </tr> 
      <tr> 
       <td> 
        <asp:Label ID="lblTitle" runat="server" Text="Title" Height="16px" Width="134px"></asp:Label> 
        <asp:Label ID="lblSSN" runat="server" Text="SSN" Height="16px" Width="125px"></asp:Label> 
        <asp:Label ID="lblDOB" runat="server" Text="DOB" Height="16px" Width="134px"></asp:Label> 
        <asp:Label ID="lblHireDate" runat="server" Text="Hire Date" Height="16px" Width="131px"></asp:Label> 
       </td> 
      </tr> 
      <tr> 
       <td> 
        <asp:TextBox ID="tbTitle" runat="server" Height="16px" Width="125px"></asp:TextBox> 
        <asp:TextBox ID="tbSSN" runat="server" Height="16px" Width="125px"></asp:TextBox> 
        <asp:TextBox ID="tbDOB" runat="server" Height="16px" Width="125px"></asp:TextBox> 
        <asp:TextBox ID="tbHireDate" runat="server" Height="16px" Width="125px"></asp:TextBox> 
       </td> 
      </tr> 
      <tr> 
       <td> 
        <asp:Label ID="lblAddress" runat="server" Text="Address" Height="16px" Width="132px"></asp:Label> 
        <asp:Label ID="lblCity" runat="server" Text="City" Height="16px" Width="132px"></asp:Label> 
        <asp:Label ID="lblState" runat="server" Text="State" Height="16px" Width="133px"></asp:Label> 
        <asp:Label ID="lblZip" runat="server" Text="Zip" Height="16px" Width="125px"></asp:Label> 
       </td> 
      </tr> 
      <tr> 
       <td> 
        <asp:TextBox ID="tbAddress" runat="server" Height="16px" Width="125px"></asp:TextBox> 
        <asp:TextBox ID="tbCity" runat="server" Height="16px" Width="125px"></asp:TextBox> 
        <asp:TextBox ID="tbState" runat="server" Height="16px" Width="125px"></asp:TextBox> 
        <asp:TextBox ID="tbZip" runat="server" Height="16px" Width="125px"></asp:TextBox> 
       </td> 
      </tr> 
      <tr> 
       <td> 
        <br /> 
        <asp:Button ID="btnCancelNew" runat="server" Text="Cancel" Font-Size="X-Small" /> 
       </td> 
      </tr> 
     </table> 

Вот моя база данных sql, которая заполняет gridview на странице. Это просто сортировка данных по объекту.

private void BindGrid() 
{ 
    //set up arguments for the stored proc 
    int? FacilityID = (ddlFacility2.SelectedValue.Equals("-1")) ? (int?)null : int.Parse(ddlFacility2.SelectedValue); 
    int? OtherDataID = null; 

    //bind 
    GvReportResults.DataSource = this.DataLayer.model.MS_spGetOtherData(FacilityID, OtherDataID); 
    GvReportResults.DataBind(); 
} 

private void ResetForm() 
{ 
    try 
    { 
     //facility dropdown 
     ddlFacility2.Items.Clear(); 
     ddlFacility2.DataSource = this.DataLayer.model.MS_spGetFacilityInfo(null).OrderBy(x => x.FacilityName); 
     ddlFacility2.DataTextField = "FacilityName"; 
     ddlFacility2.DataValueField = "FacilityID"; 
     ddlFacility2.DataBind(); 
     ddlFacility2.Items.Insert(0, new ListItem("All Facility Records..", "-1")); 

     BindGrid(); 

    } 
    catch (Exception ex) 
    { 
     this.SetMessage(ex.ToString(), PageMessageType.Error); 
     AISLogger.WriteException(ex); 
    } 
} 
+0

Wut вы пробовали до сих пор? –

ответ

Смежные вопросы