asp.net dropdownlist 问题
前台代码<asp:DropDownListID="DropDownList1"runat="server"><asp:ListItemSelected="True">20...
前台代码<asp:DropDownList ID="DropDownList1" runat="server" >
<asp:ListItem Selected="True">2008</asp:ListItem><asp:ListItem >2009</asp:ListItem><asp:ListItem>2010</asp:ListItem>
</asp:DropDownList>
后台string mysql = "select * from chuqin where staffid='"+this.txtID.Text + "',year='"+this .DropDownList1.SelectedValue.ToString ()+
"',month='"+this .DropDownList2.SelectedValue.ToString () +"'"; SqlDataAdapter MyAdapter = new SqlDataAdapter(mysql ,cn );
DataSet MySet = new DataSet(); MyAdapter.Fill(MySet, "chuqin");
this.GridView1.DataSource = MySet;
this.GridView1.DataBind();
请问有什么错误 展开
<asp:ListItem Selected="True">2008</asp:ListItem><asp:ListItem >2009</asp:ListItem><asp:ListItem>2010</asp:ListItem>
</asp:DropDownList>
后台string mysql = "select * from chuqin where staffid='"+this.txtID.Text + "',year='"+this .DropDownList1.SelectedValue.ToString ()+
"',month='"+this .DropDownList2.SelectedValue.ToString () +"'"; SqlDataAdapter MyAdapter = new SqlDataAdapter(mysql ,cn );
DataSet MySet = new DataSet(); MyAdapter.Fill(MySet, "chuqin");
this.GridView1.DataSource = MySet;
this.GridView1.DataBind();
请问有什么错误 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询