sql语句:
Dim txtchexing As DropDownList
txtchexing=e.Item.Cells(8).Controls(0)
Dim strSql As String
strSql="Update car Set 车号='" & txtnm.Text & "',始发站='" & txtshifa.Text & "',终点站='" & txtzhongdian.Text & "',开车时间='" & txtkaiche.Text & "',到达时间='" & txtdaoda.Text & "',座位数='" & txtzuowei.Text & "',车型=" & cstr(txtchexing.SelectedItem.text) & " Where 编号=" & MyDataGrid.DataKeys(CInt(E.Item.ItemIndex))
用的是datagrid自定义列
<asp:TemplateColumn HeaderText="车型" >
<ItemTemplate>
<asp:label Text='<%# Container.DataItem("车型") %>' runat="server"/>
</ItemTemplate>
<EditItemTemplate>
<asp:dropdownlist id="theGrade" SelectedIndex='<%# Container.DataItem("车型")-1 %>' runat="server">
<asp:listitem >豪华卧铺</asp:listitem>
<asp:listitem >长途大巴</asp:listitem>
<asp:listitem >中型客车</asp:listitem>
<asp:listitem >中巴</asp:listitem>
<asp:listitem >小型客车</asp:listitem>
</asp:dropdownlist >
</EditItemTemplate>
</asp:TemplateColumn>
帮帮忙呀
------解决方案--------------------------------------------------------
既然车型文本类型的,就直接赋值
车型=" & txtchexing.SelectedItem.text & "