【发布时间】:2016-03-01 15:09:08
【问题描述】:
我已经创建了一个数据表:
DataTable dt=new DataTable();
dt.Columns.Add("Country", typeof(string))
dt.Columns.Add("place", typeof(string))
dt.Columns.Add("Price", typeof(string))
dt.Columns.Add("Desc", typeof(string))
我在这个数据表中插入了一些数据:
DataRow dtrow = dt.NewRow(); // Create New Row
dtrow["Country"] = "India"; //Bind Data to Columns
dtrow["place"] = "wizag";
dtrow["Price"] = "7520";
dtrow["Desc"] = "Anywhere";
dt.Rows.Add(dtrow);
dtrow = dt.NewRow(); // Create New Row
dtrow["Country"] = "India"; //Bind Data to Columns
dtrow["place"] = "Goa";
dtrow["price"] = "4500";
dtrow["Desc"] = "Anything";
dt.Rows.Add(dtrow);
我已将此数据表与我的网格视图绑定。我还在 mmy aspx 页面中添加了一个文本框和一个搜索按钮。我的要求是我想根据用户输入搜索数据,例如 4500 或 wizag,如果国家名称相同,我想在一行中显示它
我该怎么做?
【问题讨论】:
-
尝试mva.microsoft.com/en-us/training-courses/… 或在asp.net 上获得一本好书
-
如果您向我们展示您的尝试,并描述您遇到的问题,您更有可能得到有用的答案。
-
先生,我只想搜索数据表作为用户提供的输入,它可能是任何国家名称或价格或地点 .................... …………
-
@abhinaykumar 我的方法是否帮助您解决了问题?