我如何...在asp.net c#中使用组合框绑定Datagird视图 [英] How do I...Bind Datagird view with combo box in asp.net c#
问题描述
大家好,
i需要帮助将datagird与数据库值绑定,具有以下条件
示例:customer是一个表,其中包含字段CustNo,CustName,CustPlace,CustDesignation
a)使用连接字符串方法在网格视图中显示的数据。
b)应该有编辑,删除,更新按钮。
c)当我点击编辑CustPlace时,CustDesignation字段将显示在下拉列表中,显示位置和名称。
d)我应该是能够从下拉列表中选择地点和指定以及更新和保存选项。记录应该保存选定的值。
谢谢,如果你有人可以帮助我...
我已经尝试了很多代码项目的样本,但没有任何成功。我不是专业的开发人员,希望有人帮助我...
确保CustPlace,CustDesignation字段显示在名为Place and Designation的其他表格中。
例如我使用此代码o绑定网格..
当绑定数据时我收到错误
private void BindData()
{
string strQuery =select CustomerID,CustPlace,CustDesignation+
来自客户;
SqlCommand cmd = new SqlCommand(strQuery);
GridView1 .DataSource = GetData(cmd);
GridView1.DataBind();
}
我将数据绑定到dropdownlist的问题任何解决方案怎么能我绑定! ??
Hi All,
i need a help to bind datagird with database values, with these below condition
Example : customer is a table with fields CustNo, CustName, CustPlace, CustDesignation
a) data to be displayed in grid view using connection string method.
b) there should be an EDIT, DELETE, UPDATE Button.
c) When i click on EDIT CustPlace, CustDesignation fields to be displayed in dropdownlist display Place and Designation under it.
d) I should be able to select place and designation from the dropdownlist and option to UPDATE AND SAVE. records should save with selected values.
Thanks if u anyone can help me in this..
I have tried many samples of codeproject but nothing works out.. i am not professional in development, hope some one help me in this..
Make sure CustPlace, CustDesignation fields are displayed from other table named Place and Designation.
For example I used this code o bind grid..
When binding data i am getting error
private void BindData()
{
string strQuery = "select CustomerID,CustPlace,CustDesignation" +
" from customers";
SqlCommand cmd = new SqlCommand(strQuery);
GridView1.DataSource = GetData(cmd);
GridView1.DataBind();
}
Problem when I bind data to dropdownlist any solution how can i bind! ??
推荐答案
尝试
DropDownList Controls在ASP.Net DataGrid中 [ ^ ]
ASP.NET的多列下拉列表DataGrid [ ^ ]
在DataGrids中使用DropDownLists [ ^ ]
Try
DropDownList Controls In an ASP.Net DataGrid[^]
Multiple Column Dropdownlist for the ASP.NET DataGrid[^]
Working with DropDownLists in DataGrids[^]
这篇关于我如何...在asp.net c#中使用组合框绑定Datagird视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!