Новые сообщения [новые:0]
Дайджест
Горячие темы
Избранное [новые:0]
Форумы
Пользователи
Статистика
Статистика нагрузки
Мод. лог
Поиск
|
09.08.2011, 03:53
|
|||
---|---|---|---|
|
|||
Помогите новичку сформировать код записи данных из GridView в БД |
|||
#18+
Необохимо что бы после редактирования записи в GridView и нажатии UPDATE введенные данные сохранялись в БД NorthWind. Не могу обработать событие "protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)", если это то конечно. Вот собственно сам код: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class _Default : System.Web.UI.Page { DataClassesDataContext rpt = new DataClassesDataContext(); protected void Page_Load(object sender, EventArgs e) { GridView1.DataSource = rpt.Customers.ToList(); GridView1.DataBind(); } protected void Button1_Click(object sender, EventArgs e) { GridView1.DataSource = from n in rpt.Customers where n.Country == DropDownList1.Text & n.City == DropDownList2.Text select n; //GridView1.DataSource = rpt.Customers.Where(u => u.Country == DropDownList1.Text & u.City == DropDownList2.Text); GridView1.DataBind(); } protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e) { GridView1.PageIndex = e.NewPageIndex; GridView1.DataBind(); } protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e) { GridView1.EditIndex = e.NewEditIndex; GridView1.DataBind(); } protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e) { GridViewRow row = GridView1.Rows[e.RowIndex]; //GridView1.Rows= ((TextBox)(row.Cells[1].Controls[0])).Text; //GridView1.UpdateRow(e.RowIndex,true); GridView1.EditIndex = -1; GridView1.DataBind(); } protected void GridView1_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e) { GridView1.EditIndex = -1; GridView1.DataBind(); } } ... |
|||
:
Нравится:
Не нравится:
|
|||
|
11.08.2011, 07:08
|
|||
---|---|---|---|
|
|||
Помогите новичку сформировать код записи данных из GridView в БД |
|||
#18+
Что никто не может добавить данные из GridView в БД при помощи LINQ TO SQL? ... |
|||
:
Нравится:
Не нравится:
|
|||
|
11.08.2011, 18:31
|
|||
---|---|---|---|
Помогите новичку сформировать код записи данных из GridView в БД |
|||
#18+
bv-alex, Ну, вы то не можете. Почему другие должны мочь? ... |
|||
:
Нравится:
Не нравится:
|
|||
|
12.08.2011, 10:34
|
|||
---|---|---|---|
|
|||
Помогите новичку сформировать код записи данных из GridView в БД |
|||
#18+
Сам задал сам отвечу. Вот код: Код: plaintext 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11.
... |
|||
:
Нравится:
Не нравится:
|
|||
|
|
start [/forum/topic.php?fid=17&tablet=1&tid=1350663]: |
0ms |
get settings: |
9ms |
get forum list: |
14ms |
check forum access: |
4ms |
check topic access: |
4ms |
track hit: |
168ms |
get topic data: |
13ms |
get forum data: |
2ms |
get page messages: |
47ms |
get tp. blocked users: |
2ms |
others: | 291ms |
total: | 554ms |
0 / 0 |