C#中怎么将现在时间存入sql server 05中
protectedvoidListView1_ItemInserting(objectsender,ListViewInsertEventArgse){e.Values[...
protected void ListView1_ItemInserting(object sender, ListViewInsertEventArgs e)
{
e.Values["Id"] = Guid.NewGuid();
DropDownList DropDownList1 = (DropDownList)e.Item.FindControl("DropDownList1");
e.Values["InType"] = Convert.ToInt32(DropDownList1.SelectedValue);
string Date = DateTime.Now.ToString();
e.Values["InData"] = DateTime.Parse(Date);
}
我在listview的inserting事件中想插入数据时初始化一个id和一个当前日期,但是日期这里总是报错(ObjectDataSource“ObjectDataSource1”未能找到带参数的非泛型方法“Insert”: Id, InType, InDate, Price, Count, Amount, InData。)谁能告诉我正确的写法,只剩10分了抱歉 展开
{
e.Values["Id"] = Guid.NewGuid();
DropDownList DropDownList1 = (DropDownList)e.Item.FindControl("DropDownList1");
e.Values["InType"] = Convert.ToInt32(DropDownList1.SelectedValue);
string Date = DateTime.Now.ToString();
e.Values["InData"] = DateTime.Parse(Date);
}
我在listview的inserting事件中想插入数据时初始化一个id和一个当前日期,但是日期这里总是报错(ObjectDataSource“ObjectDataSource1”未能找到带参数的非泛型方法“Insert”: Id, InType, InDate, Price, Count, Amount, InData。)谁能告诉我正确的写法,只剩10分了抱歉 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询