C#ASP.NET无法将联系人页面上载到SQL Server 2008 R2

C#ASP.NET无法将联系人页面上载到SQL Server 2008 R2,c#,asp.net,ado.net,sql-server-2008-r2,C#,Asp.net,Ado.net,Sql Server 2008 R2,首先,我要说,我是ASP新手,在过去的几周里,我已经尽了最大的努力来学习这个脚本。我在设置aspx.cs页面以获取要发布到服务器上的信息时遇到问题。任何帮助都将不胜感激 我在下面包含了后端和web表单的代码。web表单是一个需要收集文本字段、RadioButton、dropdownlist和checkboxlist的页面 RadioButton-询问需要回答是或否的问题 复选框列表-如果选中,则插入1;如果未选中,则插入0 需要能够使用asp.net 2.0、IIS 6、C#、SQL Serve

首先,我要说,我是ASP新手,在过去的几周里,我已经尽了最大的努力来学习这个脚本。我在设置
aspx.cs
页面以获取要发布到服务器上的信息时遇到问题。任何帮助都将不胜感激

我在下面包含了后端和web表单的代码。web表单是一个需要收集文本字段、RadioButton、dropdownlist和checkboxlist的页面

RadioButton-询问需要回答是或否的问题 复选框列表-如果选中,则插入1;如果未选中,则插入0

需要能够使用asp.net 2.0、IIS 6、C#、SQL Server 2008 R2

我用数字替换了所有实际ID**

后端
public分部类\u默认值:System.Web.UI.Page
{
公共字符串GetConnectionString()
{
//设置web配置文件中的连接字符串“ConnString”是连接字符串的名称
返回ConfigurationManager.ConnectionString[“MyConString”].ConnectionString;
}
私有void ExecuteInsert(串1、串2、串3、串4、串5、串6、串7、串8、串9、串10、串11、串12、串13、串14、串15、串16、串17、串18、串19、串20、串21、串22、串23、串24、串25、串26、串27、串28、串29、串30、串31、串32、串g 33、字符串34、字符串35、字符串36、字符串37、字符串38、字符串39、字符串40、字符串41、字符串42、字符串43、字符串44、字符串45、字符串46、字符串47、字符串48、字符串49、字符串50、字符串51、字符串52、字符串53、字符串54、字符串55、字符串56、字符串57、字符串58、字符串59、字符串60、字符串61、字符串62、字符串63、字符串64、st环65,串66)
{
SqlConnection conn=新的SqlConnection(GetConnectionString());
string sql=“插入webContactForm(1、2、3、4、5、6、7、8、9、10、11、12、13、14、15、16、17、18、19、20、21、22、23、24、25、26、27、28、29、30、31、32、33、34、35、36、37、38、39、40、42、43、44、45、46、48、49、50、51、52、53、55、56、57、58、59、60、61、62、63、64、66)值(@1,  @2,  @3,  @4,  @5,  @6,  @7,  @8,  @9,  @10, @11, @12, @13, @14, @15, @16, @17, @18, @19, @20, @21, @22, @23, @24, @25, @26, @27, @28, @29, @30, @31, @32, @33, @34, @35, @36, @37, @38, @39, @40, @41, @42, @43, @44, @45, @46, @47, @48, @49, @50, @51, @52, @53, @54, @55, @56, @57, @58, @59, @60, @61, @62, @63, @64, @65, @66)";
尝试
{
conn.Open();
SqlCommand cmd=新的SqlCommand(sql,conn);
SqlParameter[]param=新的SqlParameter[66];
//param[0]=新的SqlParameter(@Contact\u id),SqlDbType.Int,20);
param[0]=新的SqlParameter(“@1”,SqlDbType.VarChar,200);
param[1]=新的SqlParameter(“@2”,SqlDbType.VarChar,200);
param[2]=新的SqlParameter(“@3”,SqlDbType.VarChar,200);
param[3]=新的SqlParameter(“@4”,SqlDbType.VarChar,200);
param[4]=新的SqlParameter(“@5”,SqlDbType.VarChar,200);
param[5]=新的SqlParameter(“@6”,SqlDbType.VarChar,200);
param[6]=新的SqlParameter(“@7”,SqlDbType.VarChar,200);
param[7]=新的SqlParameter(“@8”,SqlDbType.VarChar,200);
param[8]=新的SqlParameter(“@9”,SqlDbType.VarChar,200);
param[9]=新的SqlParameter(“@10”,SqlDbType.VarChar,200);
param[10]=新的SqlParameter(“@11”,SqlDbType.VarChar,200);
param[11]=新的SqlParameter(“@12”,SqlDbType.VarChar,200);
param[12]=新的SqlParameter(“@13”,SqlDbType.VarChar,200);
param[13]=新的SqlParameter(“@14”,SqlDbType.VarChar,200);
param[14]=新的SqlParameter(“@15”,SqlDbType.VarChar,200);
param[15]=新的SqlParameter(“@16”,SqlDbType.VarChar,200);
param[16]=新的SqlParameter(“@17”,SqlDbType.VarChar,200);
param[17]=新的SqlParameter(“@18”,SqlDbType.VarChar,200);
param[18]=新的SqlParameter(“@19”,SqlDbType.VarChar,200);
param[19]=新的SqlParameter(“@20”,SqlDbType.VarChar,200);
param[20]=新的SqlParameter(“@21”,SqlDbType.VarChar,200);
param[21]=新的SqlParameter(“@22”,SqlDbType.VarChar,200);
param[22]=新的SqlParameter(“@23”,SqlDbType.VarChar,200);
param[23]=新的SqlParameter(“@24”,SqlDbType.VarChar,200);
param[24]=新的SqlParameter(“@25”,SqlDbType.VarChar,200);
param[25]=新的SqlParameter(“@26”,SqlDbType.VarChar,200);
param[26]=新的SqlParameter(“@27”,SqlDbType.VarChar,200);
param[27]=新的SqlParameter(“@28”,SqlDbType.VarChar,200);
param[28]=新的SqlParameter(“@29”,SqlDbType.VarChar,200);
param[29]=新的SqlParameter(“@30”,SqlDbType.VarChar,200);
param[30]=新的SqlParameter(“@31”,SqlDbType.VarChar,200);
param[31]=新的SqlParameter(“@32”,SqlDbType.VarChar,200);
param[32]=新的SqlParameter(“@33”,SqlDbType.VarChar,200);
param[33]=新的SqlParameter(“@34”,SqlDbType.VarChar,200);
param[34]=新的SqlParameter(“@35”,SqlDbType.VarChar,200);
param[35]=新的SqlParameter(“@36”,SqlDbType.VarChar,200);
param[36]=新的SqlParameter(“@37”,SqlDbType.VarChar,200);
param[37]=新的SqlParameter(“@38”,SqlDbType.VarChar,200);
param[38]=新的SqlParameter(“@39”,SqlDbType.VarChar,200);
param[39]=新的SqlParameter(“@40”,SqlDbType.VarChar,200);
param[40]=新的SqlParameter(“@41”,SqlDbType.VarChar,200);
param[41]=新的SqlParameter(“@42”,SqlDbType.VarChar,200);
param[42]=新的SqlParameter(“@43”,SqlDbType.VarChar,200);
param[43]=新的SqlParameter(“@44”,SqlDbType.VarChar,200);
param[44]=新的SqlParameter(“@45”,SqlDbType.VarChar,200);
param[45]=新的SqlParameter(“@46”,SqlDbType.VarChar,200);
param[46]=新的SqlParameter(@47),SqlDbType.VarC
public partial class _Default : System.Web.UI.Page
{
    public string GetConnectionString()
    {
        //sets the connection string from your web config file "ConnString" is the name of your Connection String
        return ConfigurationManager.ConnectionStrings["MyConString"].ConnectionString;
    }

private void ExecuteInsert(string 1, string 2, string 3, string 4, string 5, string 6, string 7, string 8, string 9, string 10, string 11, string 12, string 13, string 14, string 15, string 16, string 17, string 18, string 19, string 20, string 21, string 22, string 23, string 24, string 25, string 26, string 27, string 28, string 29, string 30, string 31, string 32, string 33, string 34, string 35, string 36, string 37, string 38, string 39, string 40, string 41, string 42, string 43, string 44, string 45, string 46, string 47, string 48, string 49, string 50, string 51, string 52, string 53, string 54, string 55, string 56, string 57, string 58, string 59, string 60, string 61, string 62, string 63, string 64, string 65, string 66)
{
    SqlConnection conn = new SqlConnection(GetConnectionString());
    string sql = "INSERT INTO webContactForm (1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66) VALUES (@1,  @2,  @3,  @4,  @5,  @6,  @7,  @8,  @9,  @10, @11, @12, @13, @14, @15, @16, @17, @18, @19, @20, @21, @22, @23, @24, @25, @26, @27, @28, @29, @30, @31, @32, @33, @34, @35, @36, @37, @38, @39, @40, @41, @42, @43, @44, @45, @46, @47, @48, @49, @50, @51, @52, @53, @54, @55, @56, @57, @58, @59, @60, @61, @62, @63, @64, @65, @66)";

    try
    {
        conn.Open();
        SqlCommand cmd = new SqlCommand(sql, conn);
        SqlParameter[] param = new SqlParameter[66];
        //param[0] = new SqlParameter("@Contact_id", SqlDbType.Int, 20);
        param[0] = new SqlParameter("@1", SqlDbType.VarChar, 200);
        param[1] = new SqlParameter("@2", SqlDbType.VarChar, 200);
        param[2] = new SqlParameter("@3", SqlDbType.VarChar, 200);
        param[3] = new SqlParameter("@4", SqlDbType.VarChar, 200);
        param[4] = new SqlParameter("@5", SqlDbType.VarChar, 200);
        param[5] = new SqlParameter("@6", SqlDbType.VarChar, 200);
        param[6] = new SqlParameter("@7", SqlDbType.VarChar, 200);
        param[7] = new SqlParameter("@8", SqlDbType.VarChar, 200);
        param[8] = new SqlParameter("@9", SqlDbType.VarChar, 200);
        param[9] = new SqlParameter("@10", SqlDbType.VarChar, 200);
        param[10] = new SqlParameter("@11", SqlDbType.VarChar, 200);
        param[11] = new SqlParameter("@12", SqlDbType.VarChar, 200);
        param[12] = new SqlParameter("@13", SqlDbType.VarChar, 200);
        param[13] = new SqlParameter("@14", SqlDbType.VarChar, 200);
        param[14] = new SqlParameter("@15", SqlDbType.VarChar, 200);
        param[15] = new SqlParameter("@16", SqlDbType.VarChar, 200);
        param[16] = new SqlParameter("@17", SqlDbType.VarChar, 200);
        param[17] = new SqlParameter("@18", SqlDbType.VarChar, 200);
        param[18] = new SqlParameter("@19", SqlDbType.VarChar, 200);
        param[19] = new SqlParameter("@20", SqlDbType.VarChar, 200);
        param[20] = new SqlParameter("@21", SqlDbType.VarChar, 200);
        param[21] = new SqlParameter("@22", SqlDbType.VarChar, 200);
        param[22] = new SqlParameter("@23", SqlDbType.VarChar, 200);
        param[23] = new SqlParameter("@24", SqlDbType.VarChar, 200);
        param[24] = new SqlParameter("@25", SqlDbType.VarChar, 200);
        param[25] = new SqlParameter("@26", SqlDbType.VarChar, 200);
        param[26] = new SqlParameter("@27", SqlDbType.VarChar, 200);
        param[27] = new SqlParameter("@28", SqlDbType.VarChar, 200);
        param[28] = new SqlParameter("@29", SqlDbType.VarChar, 200);
        param[29] = new SqlParameter("@30", SqlDbType.VarChar, 200);
        param[30] = new SqlParameter("@31", SqlDbType.VarChar, 200);
        param[31] = new SqlParameter("@32", SqlDbType.VarChar, 200);
        param[32] = new SqlParameter("@33", SqlDbType.VarChar, 200);
        param[33] = new SqlParameter("@34", SqlDbType.VarChar, 200);
        param[34] = new SqlParameter("@35", SqlDbType.VarChar, 200);
        param[35] = new SqlParameter("@36", SqlDbType.VarChar, 200);
        param[36] = new SqlParameter("@37", SqlDbType.VarChar, 200);
        param[37] = new SqlParameter("@38", SqlDbType.VarChar, 200);
        param[38] = new SqlParameter("@39", SqlDbType.VarChar, 200);
        param[39] = new SqlParameter("@40", SqlDbType.VarChar, 200);
        param[40] = new SqlParameter("@41", SqlDbType.VarChar, 200);
        param[41] = new SqlParameter("@42", SqlDbType.VarChar, 200);
        param[42] = new SqlParameter("@43", SqlDbType.VarChar, 200);
        param[43] = new SqlParameter("@44", SqlDbType.VarChar, 200);
        param[44] = new SqlParameter("@45", SqlDbType.VarChar, 200);
        param[45] = new SqlParameter("@46", SqlDbType.VarChar, 200);
        param[46] = new SqlParameter("@47", SqlDbType.VarChar, 200);
        param[47] = new SqlParameter("@48", SqlDbType.VarChar, 200);
        param[48] = new SqlParameter("@49", SqlDbType.VarChar, 200);
        param[49] = new SqlParameter("@50", SqlDbType.VarChar, 200);
        param[50] = new SqlParameter("@51", SqlDbType.VarChar, 200);
        param[51] = new SqlParameter("@52", SqlDbType.VarChar, 200);
        param[52] = new SqlParameter("@53", SqlDbType.VarChar, 200);
        param[53] = new SqlParameter("@54", SqlDbType.VarChar, 200);
        param[54] = new SqlParameter("@55", SqlDbType.VarChar, 200);
        param[55] = new SqlParameter("@56", SqlDbType.VarChar, 200);
        param[56] = new SqlParameter("@57", SqlDbType.VarChar, 200);
        param[57] = new SqlParameter("@58", SqlDbType.VarChar, 200);
        param[58] = new SqlParameter("@59", SqlDbType.VarChar, 200);
        param[59] = new SqlParameter("@60", SqlDbType.VarChar, 200);
        param[60] = new SqlParameter("@61", SqlDbType.VarChar, 200);
        param[61] = new SqlParameter("@62", SqlDbType.VarChar, 200);
        param[62] = new SqlParameter("@63", SqlDbType.VarChar, 200);
        param[63] = new SqlParameter("@64", SqlDbType.VarChar, 200);
        param[64] = new SqlParameter("@65", SqlDbType.VarChar, 200);
        param[65] = new SqlParameter("@66", SqlDbType.VarChar, 200);
    param[66] = new SqlParameter("@67", SqlDbType.VarChar, 200);

        param[0].Value = 1;
        param[1].Value = 2;
        param[2].Value = 3;
        param[3].Value = 4;
        param[4].Value = 5;
        param[5].Value = 6;
        param[6].Value = 7;
        param[7].Value = 8;
        param[8].Value = 9;
        param[9].Value = 10;
        param[10].Value = 11;
        param[11].Value = 12;
        param[12].Value = 13;
        param[13].Value = 14;
        param[14].Value = 15;
        param[15].Value = 16;
        param[16].Value = 17;
        param[17].Value = 18;
        param[18].Value = 19;
        param[19].Value = 20;
        param[20].Value = 21;
        param[21].Value = 22;
        param[22].Value = 23;
        param[23].Value = 24;
        param[24].Value = 25;
        param[25].Value = 26;
        param[26].Value = 27;
        param[27].Value = 28;
        param[28].Value = 29;
        param[29].Value = 30;
        param[30].Value = 31;
        param[31].Value = 32;
        param[32].Value = 33;
        param[33].Value = 34;
        param[34].Value = 35;
        param[35].Value = 36;
        param[36].Value = 37;
        param[37].Value = 38;
        param[38].Value = 39;
        param[39].Value = 40;
        param[40].Value = 41;
        param[41].Value = 42;
        param[42].Value = 43;
        param[43].Value = 44;
        param[44].Value = 45;
        param[45].Value = 46;
        param[46].Value = 47;
        param[47].Value = 48;
        param[48].Value = 49;
        param[49].Value = 50;
        param[50].Value = 51;
        param[51].Value = 52;
        param[52].Value = 53;
        param[53].Value = 54;
        param[54].Value = 55;
        param[55].Value = 56;
        param[56].Value = 57;
        param[57].Value = 58;
        param[58].Value = 59;
        param[59].Value = 60;
        param[60].Value = 61;
        param[61].Value = 62;
        param[62].Value = 63;
        param[63].Value = 64;
        param[64].Value = 65;
        param[65].Value = 66;
        param[66].Value = 67;

        //create loop to insert
        for (int i = 0; i < param.Length; i++)
        {
            cmd.Parameters.Add(param[i]);
        }

        cmd.CommandType = CommandType.Text;
        cmd.ExecuteNonQuery();
    }
    catch (System.Data.SqlClient.SqlException ex)
    {
        string msg = "Error occured while inserting:";
        msg += ex.Message;
        throw new Exception(msg);
    }
    finally
    {
        conn.Close();
    }
    }
    private object GetConnectionString(string p)
    {
throw new NotImplementedException();
    }
    protected void Button1_Click(object sender, EventArgs e){
        //call the method to execute insert to the database
        cmd.Parameters.Add(new SqlParameter("@MyParamter", "my value"));

        ClearControls(Page);
}
}
 <%@ Page Language="C#"  AutoEventWireup="true" CodeFile="Default.aspx.cs"" Inherits="Default2" %>

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 <html xmlns="http://www.w3.org/1999/xhtml">

 <head id="Head1" runat="server">
<title>Contact Us</title>

  </head>
   <body>
    <form id="form1" runat="server">
     <div>
      <table class="style1">
        <tr>
            <td class="style4">TextBox column 1:</td>
            <td class="style2">
                <asp:TextBox ID="1" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style4">TextBox column 2:</td>
            <td class="style2">
                <asp:TextBox ID="LName" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style4">3 TextBox column 3,4,5:</td>
            <td class="style2">
                <asp:TextBox ID="3" runat="server" Width="60px"></asp:TextBox>-
                <asp:TextBox ID="4" runat="server" Width="59px"></asp:TextBox>-
                <asp:TextBox ID="5" runat="server" Width="62px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style4">TextBox column 6:</td>
            <td class="style2">
                <asp:TextBox ID="6" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style4">ListItem column 7:</td>
            <td class="style2">
            <asp:DropDownList ID="7" runat="server"
                              AppendDataBoundItems="true">
            <asp:ListItem Value="-1">Select</asp:ListItem>
            <asp:ListItem>A</asp:ListItem>
            <asp:ListItem>B</asp:ListItem>
            <asp:ListItem>C</asp:ListItem>
            <asp:ListItem>D</asp:ListItem>
            <asp:ListItem>E</asp:ListItem>
            <asp:ListItem>F</asp:ListItem>
            <asp:ListItem>G</asp:ListItem>
            </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td class="style4">RadioButton column 8</td>
            <td class="style2">
                <asp:RadioButton ID="Yes" runat="server" Checked="True" />
                <asp:RadioButton ID="No" runat="server" />
            </td>
        </tr>
        <tr>
            <td class="style4">TextBox column 9:</td>
            <td class="style2">
                <asp:TextBox ID="9" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style4">TextBox column 10:</td>
            <td class="style2">
                <asp:TextBox ID="ClientLName" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style4">RadioButton Column 11:</td>
            <td class="style2">
                <asp:RadioButton ID="Female" runat="server" />
                <asp:RadioButton ID="Male" runat="server" />
            </td>
        </tr>
        <tr>
            <td class="">3 TextBox column 12,13,14:</td>
            <td class="">
                <asp:TextBox ID="12" runat="server" Width="50px"></asp:TextBox>(mm)/<asp:TextBox ID="13" runat="server" Width="50px"></asp:TextBox>(dd)/<asp:TextBox ID="14" runat="server" Width="85px"></asp:TextBox>(yyyy)
            </td>
        </tr>
        <tr>
            <td class="style4">TextBox column 15:</td>
            <td class="style2">
                <asp:TextBox ID="15" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style4">TextBox column 16:</td>
            <td class="style2">
                <asp:TextBox ID="16" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style4">TextBox column 17:</td>
            <td class="style2">
                <asp:TextBox ID="17" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style4">Dropdownlist column 18:</td>
            <td class="style2">
            <asp:DropDownList ID="18" runat="server"
                              AppendDataBoundItems="true">
         <asp:ListItem value="-1">Select State</asp:ListItem>
         <asp:ListItem value="AL">Alabama</asp:ListItem>
         <asp:ListItem value="AR">Arkansas</asp:ListItem>
         <asp:ListItem value="AZ">Arizona</asp:ListItem>
         <asp:ListItem value="CA">California</asp:ListItem>
         <asp:ListItem value="CO">Colorado</asp:ListItem>
         <asp:ListItem value="CT">Connecticut</asp:ListItem>
         <asp:ListItem value="DC">District of Columbia</asp:ListItem>
         <asp:ListItem value="DE">Delaware</asp:ListItem>
         <asp:ListItem value="FL">Florida</asp:ListItem>
         <asp:ListItem value="GA">Georgia</asp:ListItem>
         <asp:ListItem value="IA">Iowa</asp:ListItem>
         <asp:ListItem value="ID">Idaho</asp:ListItem>
         <asp:ListItem value="IL">Illinois</asp:ListItem>
         <asp:ListItem value="IN">Indiana</asp:ListItem>
         <asp:ListItem value="KS">Kansas</asp:ListItem>
         <asp:ListItem value="KY">Kentucky</asp:ListItem>
         <asp:ListItem value="LA">Louisiana</asp:ListItem>
         <asp:ListItem value="MA">Massachusetts</asp:ListItem>
         <asp:ListItem value="MD">Maryland</asp:ListItem>
         <asp:ListItem value="ME">Maine</asp:ListItem>
         <asp:ListItem value="MI">Michigan</asp:ListItem>
         <asp:ListItem value="MN">Minnesota</asp:ListItem>
         <asp:ListItem value="MO">Missouri</asp:ListItem>
         <asp:ListItem value="MS">Mississippi</asp:ListItem>
         <asp:ListItem value="MT">Montana</asp:ListItem>
         <asp:ListItem value="NC">North Carolina</asp:ListItem>
         <asp:ListItem value="ND">North Dakota</asp:ListItem>
         <asp:ListItem value="NE">Nebraska</asp:ListItem>
         <asp:ListItem value="NH">New Hampshire</asp:ListItem>
         <asp:ListItem value="NJ">New Jersey</asp:ListItem>
         <asp:ListItem value="NM">New Mexico</asp:ListItem>
         <asp:ListItem value="NV">Nevada</asp:ListItem>
         <asp:ListItem value="NY">New York</asp:ListItem>
         <asp:ListItem value="OH">Ohio</asp:ListItem>
         <asp:ListItem value="OK">Oklahoma</asp:ListItem>
         <asp:ListItem value="OR">Oregon</asp:ListItem>
         <asp:ListItem value="PA">Pennsylvania</asp:ListItem>
         <asp:ListItem value="RI">Rhode Island</asp:ListItem>
         <asp:ListItem value="SC">South Carolina</asp:ListItem>
         <asp:ListItem value="SD">South Dakota</asp:ListItem>
         <asp:ListItem value="TN">Tennessee</asp:ListItem>
         <asp:ListItem value="TX">Texas</asp:ListItem>
         <asp:ListItem value="UT">Utah</asp:ListItem>
         <asp:ListItem value="VA">Virginia</asp:ListItem>
         <asp:ListItem value="VT">Vermont</asp:ListItem>
         <asp:ListItem value="WA">Washington</asp:ListItem>
         <asp:ListItem value="WI">Wisconsin</asp:ListItem>
         <asp:ListItem value="WV">West Virginia</asp:ListItem>
         <asp:ListItem value="WY">Wyoming</asp:ListItem>
            </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td class="style4">TextBox column 19:</td>
            <td class="style2">
                <asp:TextBox ID="19" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
        <td>
        <h1>
        Providing:
       </h1>
        </td>
        <td>

        </td>
        </tr>
        <tr>
        <td>
            <asp:CheckBoxList ID="CheckBoxList1" runat="server">
                <asp:ListItem Value="20">Want 1</asp:ListItem>
                <asp:ListItem Value="21">Want 2</asp:ListItem>
                <asp:ListItem Value="22">Want 3</asp:ListItem>
                <asp:ListItem Value="23">Want 4</asp:ListItem>
                <asp:ListItem Value="24">Want 5</asp:ListItem>
                <asp:ListItem Value="25">Want 6</asp:ListItem>
                <asp:ListItem Value="26">Want 7</asp:ListItem>
                <asp:ListItem Value="27">Want 8</asp:ListItem>
                <asp:ListItem Value="28">Want 9</asp:ListItem>
                <asp:ListItem Value="29">Want 10</asp:ListItem>
                <asp:ListItem Value="30">Want 11</asp:ListItem>
                <asp:ListItem Value="31">Want 12</asp:ListItem>
                <asp:ListItem Value="32">Want 13</asp:ListItem>
                <asp:ListItem Value="33">Want 14</asp:ListItem>
                <asp:ListItem Value="34">Want 15</asp:ListItem>
                <asp:ListItem Value="35">Want 16</asp:ListItem>
                <asp:ListItem Value="36">Want 17</asp:ListItem>
                <asp:ListItem Value="37">Want 18</asp:ListItem>
                <asp:ListItem Value="38">Want 19</asp:ListItem>
                <asp:ListItem Value="39">Want 20</asp:ListItem>
                <asp:ListItem Value="40">Want 21</asp:ListItem>
            </asp:CheckBoxList>
        </td>
        <td>
        <asp:CheckBoxList ID="CheckBoxList2" runat="server">
                <asp:ListItem Value="41">Want 22</asp:ListItem>
                <asp:ListItem Value="42">Want 23</asp:ListItem>
                <asp:ListItem Value="43">Want 24</asp:ListItem>
                <asp:ListItem Value="44">Want 25</asp:ListItem>
                <asp:ListItem Value="45">Want 26</asp:ListItem>
                <asp:ListItem Value="46">Want 27</asp:ListItem>
                <asp:ListItem Value="47">Want 28</asp:ListItem>
                <asp:ListItem Value="48">Want 29</asp:ListItem>
                <asp:ListItem Value="49">Want 30</asp:ListItem>
                <asp:ListItem Value="50">Want 31</asp:ListItem>
                <asp:ListItem Value="51">Want 32</asp:ListItem>
                <asp:ListItem Value="52">Want 33</asp:ListItem>
                <asp:ListItem Value="53">Want 34</asp:ListItem>
                <asp:ListItem Value="54">Want 35</asp:ListItem>
                <asp:ListItem Value="55">Want 36</asp:ListItem>
                <asp:ListItem Value="56">Want 37</asp:ListItem>
                <asp:ListItem Value="57">Want 38</asp:ListItem>
                <asp:ListItem Value="58">Want 39</asp:ListItem>
                <asp:ListItem Value="59">Want 40</asp:ListItem>
                <asp:ListItem Value="60">Want 41</asp:ListItem>
                <asp:ListItem Value="61">Want 42</asp:ListItem>
            </asp:CheckBoxList>
        </td>
        </tr>
        <tr>
            <td class="style4">Comment TextBox column 62:</td>
            <td class="style2">
                <asp:TextBox ID="62" runat="server"></asp:TextBox>
            </td>
        </tr>
    <tr>
            <td>
              <asp:CheckBoxList ID="CheckBoxList3" runat="server">
                <asp:ListItem Value="63">Have 1</asp:ListItem>
                <asp:ListItem Value="64">Have 2</asp:ListItem>
                <asp:ListItem Value="65">Have 3</asp:ListItem>
              </asp:CheckBoxList>
    </td>
            <td>
              <asp:CheckBoxList ID="CheckBoxList4" runat="server">
                <asp:ListItem Value="66">Have 4</asp:ListItem>
                <asp:ListItem Value="67">Have 5</asp:ListItem>
              </asp:CheckBoxList>
    </td>
        </tr>
    </table>
</div>
<asp:Button ID="Button1" runat="server" Text="Submit" 
                         onclick="Button1_Click" />
</form>

</body>
</html>
<asp:TextBox ID="LastName" runat="server" Width="60px"></asp:TextBox>
// access the value of the textbox as (purely an example):
if (LastName.Text=="")
{
    // Do something with a blank last name
};
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="DemoPage.aspx.cs" Inherits="DemoPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <asp:CheckBoxList id="SampleCheckBox" runat="server">
        <asp:ListItem Text="First Value" Value="1"></asp:ListItem>
        <asp:ListItem Text="Second Value" Value="2"></asp:ListItem>
        <asp:ListItem Text="Third Value" Value="3"></asp:ListItem>
    </asp:CheckBoxList>
    <br />
    <asp:TextBox ID="SampleTextBox" Width="50" runat="server"></asp:TextBox>
    <asp:ListBox ID="SampleListBox" runat="server">
        <asp:ListItem Text="First Value" Value="A"></asp:ListItem>
        <asp:ListItem Text="Second Value" Value="B"></asp:ListItem>
        <asp:ListItem Text="Third Value" Value="C"></asp:ListItem>
    </asp:ListBox>
    <asp:Button id="SubmitButton" runat="server" UseSubmitBehavior="true" />
    </div>
    </form>
</body>
</html>
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class DemoPage : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Page.IsPostBack)
        {

            string strSql = @"Insert Into SampleTable (Check1, Check2, Check3, Text, ListBoxResult) 
                                               Values (@Value1, @Value2, @Value3, @TextValue, @ListResult)";
            SqlCommand cmd = new SqlCommand(strSql);

            // Handle CheckBoxList values
            int checkValue=0;
            foreach (ListItem sampleItem in SampleCheckBox.Items)
            {
                checkValue++; //increment ID used to build parameter name
                string parmName=String.Format("@Value{0}",checkValue);
                SqlParameter newParameter = new SqlParameter();
                newParameter.ParameterName = parmName;
                if (sampleItem.Selected)
                {
                    newParameter.Value = "Y";
                    //column value in DB for field corresponding to sampleItem is "Y"
                }
                else
                {
                    newParameter.Value="N";
                    //column value in DB for field corresponding to sampleItem is "n"
                }
                cmd.Parameters.Add(newParameter);
            }

            // Handle TextBox value
            cmd.Parameters.Add("@TextValue", SampleTextBox.Text);

            // Handle ListBox selected value
            cmd.Parameters.Add("@ListResult", SampleListBox.SelectedValue);

            cmd.ExecuteNonQuery();
        }
    }
}