我正在尝试使用 SQL Server 2008 数据库将网格视图绑定到 ASP.NET 中的详细信息视图。当我尝试绑定详细信息视图时,我收到以下错误消息:
该字符串未被识别为有效的日期时间。从索引 0 开始有一个未知单词。
代码:
protected void gvstudentworkshop_SelectedIndexChanged(object sender, EventArgs e)
{
this.dvuserworkshop.Visible = true;
this.dvuserworkshop.DataBind();
this.UpdatePanel1.Update();
this.Modalenroll.Show();
}
这是我正在使用的查询:
SelectCommand="
SELECT * FROM [tblUserWorkshop]
WHERE (([WorkshopName] = @WorkshopName)
AND ([WorkshopLocation] = @WorkshopLocation)
AND ([UserID] = @UserID)
AND ([WorkshopDate] = @WorkshopDate))"
UpdateCommand="
UPDATE [tblUserWorkshop]
SET [UserWorkshopPaymentStaus] = @UserWorkshopPaymentStaus,
[ReferralSource] = @ReferralSource,
[UserWorkshopState] = @UserWorkshopState,
[UserLastName] = @UserLastName,
[UserFirstname] = @UserFirstname,
[UserMiddleInitial] = @UserMiddleInitial
WHERE [WorkshopName] = @original_WorkshopName
AND [WorkshopDate] = @original_WorkshopDate
AND [WorkshopLocation] = @original_WorkshopLocation
AND [UserID] = @original_UserID
AND (([UserWorkshopPaymentStaus] = @original_UserWorkshopPaymentStaus)
OR ([UserWorkshopPaymentStaus] IS NULL
AND @original_UserWorkshopPaymentStaus IS NULL))
AND (([ReferralSource] = @original_ReferralSource)
OR ([ReferralSource] IS NULL
AND @original_ReferralSource IS NULL))
AND (([UserWorkshopState] = @original_UserWorkshopState)
OR ([UserWorkshopState] IS NULL
AND @original_UserWorkshopState IS NULL))
AND (([UserLastName] = @original_UserLastName)
OR ([UserLastName] IS NULL AND @original_UserLastName IS NULL))
AND (([UserFirstname] = @original_UserFirstname)
OR ([UserFirstname] IS NULL
AND @original_UserFirstname IS NULL))
AND (([UserMiddleInitial] = @original_UserMiddleInitial)
OR ([UserMiddleInitial] IS NULL
AND @original_UserMiddleInitial IS NULL))">
我收到此错误消息是否有可能的原因?