日期:2014-05-18  浏览次数:21013 次

现在有两个值插不进去,"IDD","aa" 麻烦大家帮忙看看
前台
<td width="183" height="28" valign="middle" >
  <asp:DropDownList ID="DropDownList1"  
  Width="180px" Height="150px" runat="server"  
  DataSourceID="AccessDataSource1" DataTextField="text" DataValueField="text">

  </asp:DropDownList>
  <asp:AccessDataSource ID="AccessDataSource1" runat="server"  
  DataFile="App_Data/#db1.mdb" SelectCommand="SELECT [text] FROM [ts]">
  </asp:AccessDataSource>
   
  <asp:DropDownList ID="DropDownList2"  
  Width="180px" Height="150px" runat="server"  
  DataSourceID="AccessDataSource2" DataTextField="text" DataValueField="text">

  </asp:DropDownList>
  <asp:AccessDataSource ID="AccessDataSource2" runat="server"  
  DataFile="App_Data/#db1.mdb" SelectCommand="SELECT [text] FROM [by]">
  </asp:AccessDataSource>
  </td>

后台

C# code

public partial class bd : System.Web.UI.Page
{

    public string aa;
    public string idd;
    public string ksmc;
    public string brxm;
    public string jtdh;
    public string ygbh;
    public string ygxm;
    public string times;
    public void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {

            if (Request["idd"] != null)//判断是否有接受值,如果有
            {
                idd = Request["idd"].ToString();

            }
            
            if (Request["ksmc"] != null)//判断是否有接受值,如果有
            {
                ksmc = Request["ksmc"].ToString();

            }
            if (Request["brxm"] != null)//判断是否有接受值,如果有
            {
               brxm = Request["brxm"].ToString();
            }
            if (Request["jtdh"] != null)//判断是否有接受值,如果有
            {
                jtdh = Request["jtdh"].ToString();
            }
            if (Request["ygbh"] != null)//判断是否有接受值,如果有
            {
                ygbh = Request["ygbh"].ToString();
            }
            if (Request["ygxm"] != null)//判断是否有接受值,如果有
            {
               ygxm = Request["ygxm"].ToString();
            }

            if (idd == "1")
            {
                DropDownList1.Visible = true;
                DropDownList2.Visible = false;
                Image9.Visible = true;
                Image2.Visible = false;
                aa = DropDownList1.DataValueField;


            }
            if (idd == "0")
            {
                DropDownList2.Visible = true;
                DropDownList1.Visible = false;
                Image2.Visible = true;
                Image9.Visible = false;
                aa = DropDownList2.DataValueField;


            }
            txtbt1.Text = ksmc;
            txtbt2.Text = ygxm;
            txtbt3.Text = ygbh;
            txtbt4.Text = brxm;
            txtbt5.Text = jtdh;
            txtbt6.Text = DateTime.Now.ToString();



        }

    }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {


        OleDbConnection conn = new OleDbConnection();
        conn.ConnectionString = "Provider = Microsoft.Jet.OleDb.4.0;" + "Data Source =" + Server.MapPath("App_Data/#db1.mdb");
        string strVal = "'" + txtbt1.Text + "','" + txtbt2.Text + "','" + txt