tags:

views:

332

answers:

0

Hi, I use Scaffold for manage my tables data, using subsonic 2.1. just for one table I got this error message when try to view table data, i recreate related classes several times but still and just for scaffold I got this error, I can use table class and insert / edit data myself. In my table I have both nvarchar and bigint fields. What's wrong?

 Error converting data type nvarchar to bigint. 
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: Error converting data type nvarchar to bigint.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace: 


[SqlException (0x80131904): Error converting data type nvarchar to bigint.]
   System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +1948826
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4844747
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194
   System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2392
   System.Data.SqlClient.SqlDataReader.HasMoreRows() +157
   System.Data.SqlClient.SqlDataReader.ReadInternal(Boolean setTimeout) +197
   System.Data.SqlClient.SqlDataReader.Read() +9
   System.Data.Common.DataAdapter.FillLoadDataRow(SchemaMapping mapping) +78
   System.Data.Common.DataAdapter.FillFromReader(DataSet dataset, DataTable datatable, String srcTable, DataReaderContainer dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue) +164
   System.Data.Common.DataAdapter.Fill(DataSet dataSet, String srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) +353
   System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +164
   System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +287
   System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) +94
   SubSonic.SqlDataProvider.GetDataSet(QueryCommand qry) in C:\svn\subsonicproject\trunk\SubSonic\DataProviders\SqlDataProvider.cs:428
   SubSonic.DataService.GetDataSet(QueryCommand cmd) in C:\svn\subsonicproject\trunk\SubSonic\DataProviders\DataService.cs:523
   SubSonic.SqlQuery.ExecuteJoinedDataSet() in C:\svn\subsonicproject\trunk\SubSonic\SqlQuery\SqlQuery.cs:1449
   SubSonic.Scaffold.BindGrid(String orderBy) in C:\svn\subsonicproject\trunk\SubSonic\Controls\Scaffold.cs:1285
   SubSonic.Scaffold.CreateChildControls() in C:\svn\subsonicproject\trunk\SubSonic\Controls\Scaffold.cs:706
   SubSonic.Scaffold.ddlTables_SelectedIndexChanged(Object sender, EventArgs e) in C:\svn\subsonicproject\trunk\SubSonic\Controls\Scaffold.cs:750
   System.Web.UI.WebControls.ListControl.OnSelectedIndexChanged(EventArgs e) +111
   System.Web.UI.WebControls.DropDownList.RaisePostDataChangedEvent() +134
   System.Web.UI.WebControls.DropDownList.System.Web.UI.IPostBackDataHandler.RaisePostDataChangedEvent() +10
   System.Web.UI.Page.RaiseChangedEvents() +165
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1485




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053 


CREATE TABLE [dbo].[Tbl_Document](    [Code] [bigint] IDENTITY(111111111,1) NOT NULL,    [DocCode] [nvarchar](20) COLLATE  NULL,    [FkLoginID] [nvarchar](20) COLLATE  NOT NULL,    [CurrentUser] [nvarchar](20) COLLATE  NOT NULL,    [FkStatus] [smallint] NOT NULL,    [TypeWorkFlow] [nvarchar](50) COLLATE NOT NULL,    [Step] [int] NOT NULL,    [Note] [ntext] COLLATE NULL,    [FKProvince] [smallint] NOT NULL,    [NORahgiry] [nvarchar](20) COLLATE Arabic_CI_AS NULL,    [IsLock] [bit] NOT NULL,    [IsArchive] [bit] NOT NULL,    [FKTolidUnit] [nvarchar](20) COLLATE Arabic_CI_AS NOT NULL,    [OldUnitCode] [nvarchar](50) COLLATE Arabic_CI_AS NULL, CONSTRAINT [PK_Tbl_Document_1] PRIMARY KEY CLUSTERED (    [Code] ASC)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]GO