PDA

View Full Version : [DotNetNuke ASP.NET]


stella_650
28-06-2007, 09:47
Ciao ragazzi,
spero che qualcuno possa aiutarmi a risolvere qualche "problemino" con un'applicazione che devo sviluppare in Asp.Net e che dovro' successivamente importare in Dnn. Il mio problema attuale è il seguente:
Ho realizzato un file .aspx in cui viene visualizzato una tabella tramite l'oggetto gridview. I campi di tale tabella devono essere selezionabili ed editabili; realizzare questo è stato semplice ma il problema nasce nel momento in cui, selezionando un campo, si apre una nuova tabella (nuovo gridview). In quest'ultima non è possibile l'update dei valori modificati.
Nel particolare, sto utilizzando per la connessione ai db l'Sql Server 2005 Express con il Visual Studio 2005 Express; l'errore che mi viene visualizzato quando cerco di "updatare" i campi della seconda tabella è il seguente:

--------------------------------------------------------------------------
Server Error in '/DotNetNuke' Application.
--------------------------------------------------------------------------------

Sintassi non corretta in prossimità di 'nvarchar'.
Dichiarare la variabile scalare "@ID".
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: Sintassi non corretta in prossimità di 'nvarchar'.
Dichiarare la variabile scalare "@ID".

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): Sintassi non corretta in prossimità di 'nvarchar'.
Dichiarare la variabile scalare "@ID".]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +95
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +82
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +346
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +3244
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +186
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +1121
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +334
System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +407
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +149
System.Web.UI.WebControls.SqlDataSourceView.ExecuteDbCommand(DbCommand command, DataSourceOperation operation) +493
System.Web.UI.WebControls.SqlDataSourceView.ExecuteUpdate(IDictionary keys, IDictionary values, IDictionary oldValues) +915
System.Web.UI.DataSourceView.Update(IDictionary keys, IDictionary values, IDictionary oldValues, DataSourceViewOperationCallback callback) +179
System.Web.UI.WebControls.GridView.HandleUpdate(GridViewRow row, Int32 rowIndex, Boolean causesValidation) +1140
System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +835
System.Web.UI.WebControls.GridView.OnBubbleEvent(Object source, EventArgs e) +162
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +56
System.Web.UI.WebControls.GridViewRow.OnBubbleEvent(Object source, EventArgs e) +118
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +56
System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +107
System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +175
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +31
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +32
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +244
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3840

--------------------------------------------------------------------------

Va detto che entrambe le tabelle hanno un campo ID, che è la chiave per entrambi, e che è costituita (in tutti e due i casi) da numeri 'smallint' da 1 in poi. Nel dubbio, ho provato a modificare sia il nome del campo, mettendo ID 1 e ID 2, sia i valori, in modo da utilizzare valori di chiavi differenti per ciascuna tabella, ma senza avere alcun risultato.:confused:
Non riesco a capire perchè quando faccio l'update nella prima tabella non ho problemi, mentre nella seconda esce tutto questo...:muro: