'Cannot specify a column width on data type smalldatetime.'
I'm using SQL Server & I've check the data type in the db & it's same as smalldatetime.
Any suggestions would be highly appreciated.
Thanks
<Error
Column or parameter #8: Cannot specify a column width on data type smalldatetime.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Column or parameter #8: Cannot specify a column width on data type smalldatetime.
Source Error:
Line 344: Try
Line 345: myConnection.Open()
Line 346: dgdSearch.DataSource = myCommand.ExecuteReader()
Line 347: dgdSearch.DataBind()
Line 348: Finally
Source File: c:\inetpub\wwwroot\Demo Equip Log\Search Equipment.aspx.vb Line: 346
Stack Trace:
[SqlException: Column or parameter #8: Cannot specify a column width on data type smalldatetime.]
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream) +742
System.Data.SqlClient.SqlCommand.ExecuteReader() +41
Demo_Equip_Log.Search_Equipment.BindGrid() in c:\inetpub\wwwroot\Demo Equip Log\Search Equipment.aspx.vb:346
Demo_Equip_Log.Search_Equipment.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\Demo Equip Log\Search Equipment.aspx.vb:195
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750Show the code you are using to set up the parameter. I presume the message means EXACTLY what it says. Are you trying to set the length of the smalldatetime parameter? You cannot.|||Hi Doug, thanks for your response & Yep!. I've released that after I posted on the forum.
This is the first time I'm using Stored Procedure.
I've removed it & now I'm not getting that error.
However, I'm getting a different error ... I highly appreciate your suggestion.
Thanks
<Error>
Cannot compute Count for a data source that does not implement ICollection.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: Cannot compute Count for a data source that does not implement ICollection.
Source Error:
Line 345: myConnection.Open()
Line 346: dgdSearch.DataSource = myCommand.ExecuteReader()
Line 347: dgdSearch.DataBind()
Line 348: Finally
Line 349: myConnection.Close()
Source File: c:\inetpub\wwwroot\Demo Equip Log\Search Equipment.aspx.vb Line: 347
Stack Trace:
[HttpException (0x80004005): Cannot compute Count for a data source that does not implement ICollection.]
System.Web.UI.WebControls.PagedDataSource.get_DataSourceCount() +152
System.Web.UI.WebControls.PagedDataSource.get_Count() +187
System.Web.UI.WebControls.PagedDataSource.GetEnumerator() +268
System.Web.UI.WebControls.DataGrid.CreateControlHierarchy(Boolean useDataSource) +712
System.Web.UI.WebControls.BaseDataList.OnDataBinding(EventArgs e) +49
System.Web.UI.WebControls.BaseDataList.DataBind() +23
Demo_Equip_Log.Search_Equipment.BindGrid() in c:\inetpub\wwwroot\Demo Equip Log\Search Equipment.aspx.vb:347
Demo_Equip_Log.Search_Equipment.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\Demo Equip Log\Search Equipment.aspx.vb:195
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750
No comments:
Post a Comment