c# - 如何在gridview的TextBox中将字符串转换为DateTime
问题描述
protected void grvHerstellingen_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
GridViewRow row = grvHerstellingen.Rows[e.RowIndex];
int herstellingLijstIndex = row.DataItemIndex;
int klantid = (int)grvHerstellingen.DataKeys[herstellingLijstIndex].Value;
int nieuweToestelid = Convert.ToInt32((TextBox)row.Cells[1].Controls[0]);
string nieuweDatumbinnen = ((TextBox)row.Cells[2].Controls[0]);
string nieuweDatumklaar = ((TextBox)row.Cells[3].Controls[0]);
int nieuweKostprijs = Convert.ToInt32((TextBox) row.Cells[4].Controls[0]);
_c.UpdateHerstelling(nieuweDatumbinnen, nieuweKostprijs, nieuweDatumklaar, nieuweToestelid, klantid);
grvHerstellingen.EditIndex = -1;
grvHerstellingen.DataSource = _c.GetAlleKlanten();
grvHerstellingen.DataBind();
}
您好,我正在尝试将我的文本框的nieuweDatumbinnen
and转换nieuweDatumklaar
为 DateTime,但我还没有找到任何东西。有什么建议么?
解决方案
推荐阅读
- linux - 如何让两个程序使用 std io 进行通信?
- python - 无法选择列表元素并将其附加到现有 csv 中
- html - 如何在角度 7 的表中添加搜索过滤器
- javascript - 附加到 SourceBuffer 的 HTML 5 视频和音频变得不同步
- mongodb - MongoDB 内部连接的两个查询或聚合查找
- reactjs - 代码拆分不适用于 CRA + React Route v4 + 代码拆分
- python - 如何使用 VS Code 编辑器在 Python 包 PySide2.QtCore.Qt 模块上获得 Intellisense / tab-completion?
- ios - 带有 ScrollView 和导航栏 SwiftUI 的屏幕背景颜色
- r - 制作空单元格以输入包表的整数:rhandsontable
- ruby-on-rails - Rails gem outh2 authorize_url 似乎已更改