Gridview编辑和删除数据库中的记录 [英] Gridview edit and delete records from database

查看:101
本文介绍了Gridview编辑和删除数据库中的记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用ASP.NET C#和sql server 2005创建网站.
在我的网站上有搜索页面.在此页面中,我有两个下拉列表框和一个文本框,一个搜索按钮,两个单选按钮.

我有产品表和城市表.在产品表中,我有conatact_person comanyname,依此类推.在城市表中的城市,地区.当用户选择第一个下拉列表时,相应的值将添加到第二个下拉列表中,例如,用户从ddl1中选择chennai,则相应的值(如tambaram guindy,vadapalani)将自动添加到ddl2中.
现在,用户在文本框中输入搜索关键字,然后单击搜索按钮.它将在gridview中显示搜索结果.当用户想要编辑或删除网格视图时,必须在数据库中体现该网格视图的编辑和删除选项.

给出清晰的思路和逐步的编码说明.

非常感谢

I am creating website using ASP.NET C# and sql server 2005.
In my website I have search page. In this page I have two dropdownlist box and one text box and one search button, two radio buttons.

I have product table and city table. In product table I have conatact_person comanyname,and so on. In city table city, area. When user select first dropdownlist corresponding value will be added in second dropdownlist for example user select chennai from ddl1 the corresponding values like tambaram guindy,vadapalani, all are added automatically in ddl2.
Now user enter search keyword in textbox and then user click the search button. It will display search result in gridview. The grid view must have the edit and delete option when the user want to edit or delete it must refelect in database.

Give clear idea and coding step by step explanation.

Thanks alot

推荐答案

很显然,这只是一项家庭作业问题陈述,尚未付出任何努力!

高级步骤:
1.在第二个下拉列表中使用城市和相应相关位置的级联下拉列表
2.根据搜索条件-下拉选择的值和文本框文本,形成适当的搜索查询-命中数据库并返回结果.
3.将结果绑定到网格以进行读取/编辑/更新.

试试吧!
如果遇到问题,则发布特定问题.
Clearly just a homework problem statment and no effort made yet!

High level steps:
1. Use cascading dropdown for city and corresponding related place in 2nd dropdown
2. Based on the search criteria - dropdown selected values and textbox text, form a proper search query - hit database and get back result.
3. bind the result to grid for read/edit/update.

Try!
Post specific issues if/when faced.


这篇关于Gridview编辑和删除数据库中的记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆