mboost-dp1
SQL hjælp
- Forside
- ⟨
- Forum
- ⟨
- Programmering
Hej
Sidder der en haj til SQL, for det er dog ikke lige min stærke side.
Er dog stødt på sådan en fejl her.
Server Error in '/' Application.
Procedure or function AddRep has too many arguments specified.
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: Procedure or function AddRep has too many arguments specified.
Source Error:
Line 120:
Line 121: _conn.Open();
Line 122: comm.ExecuteNonQuery();
Line 123: _conn.Close();
Line 124: }
Source File: c:\inetpub\wwwroot\rep\App_Code\DAL.cs Line: 122
Stack Trace:
[SqlException (0x80131904): Procedure or function AddRep has too many arguments specified.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +388
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +815
System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) +4515
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +6553853
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds) +6556619
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite) +586
System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite) +742
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +287
DAL.ExecuteSP(String SpName) in c:\inetpub\wwwroot\rep\App_Code\DAL.cs:122
Default2.Button1_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\rep\repopret.aspx.cs:104
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +155
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3804
Hvad mangler i for at kunne se hvor fejlen ligger?
På forhånd tak
Sidder der en haj til SQL, for det er dog ikke lige min stærke side.
Er dog stødt på sådan en fejl her.
Server Error in '/' Application.
Procedure or function AddRep has too many arguments specified.
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: Procedure or function AddRep has too many arguments specified.
Source Error:
Line 120:
Line 121: _conn.Open();
Line 122: comm.ExecuteNonQuery();
Line 123: _conn.Close();
Line 124: }
Source File: c:\inetpub\wwwroot\rep\App_Code\DAL.cs Line: 122
Stack Trace:
[SqlException (0x80131904): Procedure or function AddRep has too many arguments specified.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +388
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +815
System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) +4515
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +6553853
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds) +6556619
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite) +586
System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite) +742
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +287
DAL.ExecuteSP(String SpName) in c:\inetpub\wwwroot\rep\App_Code\DAL.cs:122
Default2.Button1_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\rep\repopret.aspx.cs:104
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +155
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3804
Hvad mangler i for at kunne se hvor fejlen ligger?
På forhånd tak
Umiddelbart har du bare forsøgt at gemme til flere felter end databasen har i den tabel:
Exception Details: System.Data.SqlClient.SqlException: Procedure or function AddRep has too many arguments specified.
Hvis du eksempelvis prøver at gemme, fornavn, efternavn, adresse, tlfnr. Hvor databasen kun har navn, adresse, tlfnr.
Exception Details: System.Data.SqlClient.SqlException: Procedure or function AddRep has too many arguments specified.
Hvis du eksempelvis prøver at gemme, fornavn, efternavn, adresse, tlfnr. Hvor databasen kun har navn, adresse, tlfnr.
Foolsfriend (3) skrev:Umiddelbart har du bare forsøgt at gemme til flere felter end databasen har i den tabel:
Exception Details: System.Data.SqlClient.SqlException: Procedure or function AddRep has too many arguments specified.
Hvis du eksempelvis prøver at gemme, fornavn, efternavn, adresse, tlfnr. Hvor databasen kun har navn, adresse, tlfnr.
Hej Arne.
Er ikke helt med på hvad du gerne vil have i comm,
Men er er Addrep
@Label1 varchar(50),
@dropdownlist1 varchar(50),
@dropdownlist2 varchar(50),
@textbox7 varchar(50),
@textbox1 varchar(50),
@textbox3 varchar(50),
@textbox6 varchar(50),
@checkboxlist1 varchar(50),
@textbox4 varchar(50),
@textbox5 varchar(50),
@dropdownlist5 varchar(50),
@timelabel varchar(50),
@datelabel varchar(50),
@dropdownlist4 varchar(50),
@radiobuttonlist3 varchar(50),
@dropdownlist8 varchar(50),
@dropdownlist6 varchar(50),
@NytID int output
Er ikke helt med på hvad du gerne vil have i comm,
Men er er Addrep
@Label1 varchar(50),
@dropdownlist1 varchar(50),
@dropdownlist2 varchar(50),
@textbox7 varchar(50),
@textbox1 varchar(50),
@textbox3 varchar(50),
@textbox6 varchar(50),
@checkboxlist1 varchar(50),
@textbox4 varchar(50),
@textbox5 varchar(50),
@dropdownlist5 varchar(50),
@timelabel varchar(50),
@datelabel varchar(50),
@dropdownlist4 varchar(50),
@radiobuttonlist3 varchar(50),
@dropdownlist8 varchar(50),
@dropdownlist6 varchar(50),
@NytID int output
DAL dal = new DAL();
dal.ClearParameters();
dal.AddParameter("@Label1", Label1.Text, DbType.String);
dal.AddParameter("@dropdownlist1", DropDownList1.SelectedValue, DbType.String);
dal.AddParameter("@dropdownlist2", DropDownList2.SelectedValue, DbType.String);
dal.AddParameter("@textbox7", TextBox7.Text, DbType.String);
dal.AddParameter("@textbox1", TextBox7.Text, DbType.String);
dal.AddParameter("@textbox3", TextBox7.Text, DbType.String);
dal.AddParameter("@textbox6", TextBox7.Text, DbType.String);
dal.AddParameter("@checkboxlist1", completeAcc, DbType.String);
dal.AddParameter("@textbox4", TextBox4.Text, DbType.String);
dal.AddParameter("@textbox5", TextBox5.Text, DbType.String);
dal.AddParameter("@dropdownlist5", DropDownList5.SelectedValue, DbType.String);
dal.AddParameter("@timelabel", timelabel.Text, DbType.String);
dal.AddParameter("@datelabel", datelabel.Text, DbType.String);
dal.AddParameter("@dropdownlist4", DropDownList4.SelectedValue, DbType.String);
dal.AddParameter("@radiobuttonlist3", RadioButtonList3.SelectedValue, DbType.String);
dal.AddParameter("@radiobuttonlist8", RadioButtonList3.SelectedValue, DbType.String);
dal.AddParameter("@radiobuttonlist6", RadioButtonList3.SelectedValue, DbType.String);
dal.AddParameter("@NytID", -1, DbType.Int32, ParameterDirection.Output);
dal.ExecuteSP(SQL);
int ID = Convert.ToInt32(dal.Parameters[23].Value);
Response.Redirect("repkvitt.aspx?id=" + ID.ToString());
Er det denne du mener?
dal.ClearParameters();
dal.AddParameter("@Label1", Label1.Text, DbType.String);
dal.AddParameter("@dropdownlist1", DropDownList1.SelectedValue, DbType.String);
dal.AddParameter("@dropdownlist2", DropDownList2.SelectedValue, DbType.String);
dal.AddParameter("@textbox7", TextBox7.Text, DbType.String);
dal.AddParameter("@textbox1", TextBox7.Text, DbType.String);
dal.AddParameter("@textbox3", TextBox7.Text, DbType.String);
dal.AddParameter("@textbox6", TextBox7.Text, DbType.String);
dal.AddParameter("@checkboxlist1", completeAcc, DbType.String);
dal.AddParameter("@textbox4", TextBox4.Text, DbType.String);
dal.AddParameter("@textbox5", TextBox5.Text, DbType.String);
dal.AddParameter("@dropdownlist5", DropDownList5.SelectedValue, DbType.String);
dal.AddParameter("@timelabel", timelabel.Text, DbType.String);
dal.AddParameter("@datelabel", datelabel.Text, DbType.String);
dal.AddParameter("@dropdownlist4", DropDownList4.SelectedValue, DbType.String);
dal.AddParameter("@radiobuttonlist3", RadioButtonList3.SelectedValue, DbType.String);
dal.AddParameter("@radiobuttonlist8", RadioButtonList3.SelectedValue, DbType.String);
dal.AddParameter("@radiobuttonlist6", RadioButtonList3.SelectedValue, DbType.String);
dal.AddParameter("@NytID", -1, DbType.Int32, ParameterDirection.Output);
dal.ExecuteSP(SQL);
int ID = Convert.ToInt32(dal.Parameters[23].Value);
Response.Redirect("repkvitt.aspx?id=" + ID.ToString());
Er det denne du mener?
Gå til top
Opret dig som bruger i dag
Det er gratis, og du binder dig ikke til noget.
Når du er oprettet som bruger, får du adgang til en lang række af sidens andre muligheder, såsom at udforme siden efter eget ønske og deltage i diskussionerne.