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

dropdownlist绑定数据后,进行插入操作异常
高人们求助

我有两张表,一张信息表,一张学历表
信息表字段为id,name,card,xueli,price
学历表字段为id,code,description

xueli和code相关联

想在网页中实现插入功能,通过dropdownlist进行选择,选择的是description,但是希望插入信息表的是code的信息,但是现在讲dropdownlist绑定后,插入的数据却永远是同一个,求解?

前台代码

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="add.aspx.cs" Inherits="WebApplication5.add" %>

<!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>无标题页</title>
  <style type="text/css">
  .style1
  {
  width: 200px;
  height: 76px;
  }
  .style2
  {
  width: 337px;
  height: 76px;
  }
  .style3
  {
  height: 76px;
  }
  .style4
  {
  width: 337px;
  }
  </style>
</head>
<body>
  <form id="form1" runat="server">
  <div>
  <div>
  <div style="text-align: center">
  <br />
  <table cellpadding="5" cellspacing="0" style="border-right: silver 1px solid; border-top: silver 1px solid; border-left: silver 1px solid; border-bottom: silver 1px solid; background-color: #ffcc33;" width="800">
  <tr>
  <th align="left" nowrap="nowrap" style="height: 25px;"
  valign="middle">
  &nbsp;</th>
  </tr>
  </table>
  </div>
   
  </div>
  <table border="0" cellpadding="5" style="border-right: silver 1px solid; border-top: silver 1px solid; border-left: silver 1px solid; border-bottom: silver 1px solid;"
  width="800" cellspacing="0">
  <tr>
  <td align="right" nowrap="nowrap" style="width: 200px" valign="middle">
  </td>
  <td align="left" nowrap="nowrap" valign="middle" class="style4">
  &nbsp;</td>
  <td align="left" nowrap="nowrap" valign="middle">
  </td>
  </tr>
  <tr>
  <td nowrap="nowrap" valign="middle" style="width: 200px" align="right">
  &nbsp;</td>
  <td nowrap="nowrap" valign="middle" align="left" class="style4">
  &nbsp;
  </td>
  <td nowrap="nowrap" valign="middle" align="left">
  <%-- <asp:RequiredFieldValidator ID="rfvUserNameCheck" runat="server" ControlToValidate="txtUserNo"
&nbs