fELMEDDELADET HAR DIN CAPS-LOCK TANGENT FASTNAT? (..sen ska man inte cross-posta heller..) Felet löst när jag hade flera nedanståend eftervarandra, dvs ej fel på stored proceduresKNEPIGT FEL I STORED PROCEDUREStoo many arguments specified. VARFÖR fUNGERAR DET
Unhandled Exception: System.Data.SqlClient.SqlException: Procedure or function S5EB1TF1H@EC has too many arguments specified.
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
hAR KÖRT DEN I QUERY ANALYSER OCH FUNKAR DÄR UTMÄRKT MEN NÄR JAG SENARE ANROPAR DEN FRÅN VB.NET PROGRAMT FÅR JAG DETTA FEL.
'**************
CREATE PROC S5EB1TF1M@EC @H DECIMAL(10,7),@L DECIMAL(10,7),@C DECIMAL(10,7)
AS
DECLARE @AE2 INT
EXEC AAS5EB1TF1M@EC @AE=@AE2 output
EXEC AAAS5EB1TF1M@EC @AE2,@L ,@C
GO
'**********
ANROPAR DESSA I KRONOLOGISK ORDNING
CREATE PROC AAS5EB1TF1M@EC @AE INT output AS
SELECT DISTINCT @AE = MAX(zz5TF1@EC.ANT) FROM zz5TF1@EC
INNER JOIN EEB1TF1M ON zz5TF1@EC.Ind=EEB1TF1M.Ind
GO
CREATE PROC AAAS5EB1TF1M@EC @L DECIMAL(10,7), @C DECIMAL(10,7), @AE INT AS
DECLARE @FC DECIMAL(10,7)
DECLARE @A1 DECIMAL(10,7)
DECLARE @BE NVARCHAR(40)
SELECT DISTINCT TOP 1 @FC=EEB1TF1M.FCKE,@A1=EEB1TF1M.A1
FROM dbo.EEB1TF1M INNER JOIN dbo.zz5TF1@EC ON dbo.EEB1TF1M.Ind = dbo.zz5TF1@EC.Ind
WHERE zz5TF1@EC.ANT = @AE
UPDATE TR@EC SET S5 = @AE WHERE dbo.TR@EC.SIGNAL ='EB1M_TF1'
UPDATE TR@EC SET OM5 = (@A1*@L)WHERE dbo.TR@EC.SIGNAL ='EB1M_TF1'
UPDATE TR@EC SET PRC5=( @FC*@L) WHERE dbo.TR@EC.SIGNAL = 'EB1M_TF1'
GO
VP PROGRAMET
cn.ConnectionString = "Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Trading;Data Source=SMO;Packet Size=4096;Workstation ID=SMO"
Dim cmd As New SqlCommand
cmd.CommandText = NRA & "EB1" & objtidp & "M" & objs
Dim OPAR1 As SqlParameter = cmd.Parameters.Add("@H", SqlDbType.Decimal)
OPAR1.Value = h
Dim OPAR2 As SqlParameter = cmd.Parameters.Add("@L", SqlDbType.Decimal)
OPAR2.Value = l
Dim OPAR3 As SqlParameter = cmd.Parameters.Add("@C", SqlDbType.Decimal)
OPAR3.Value = cl
cmd.Connection = cn
cmd.CommandType = CommandType.StoredProcedure
cmd.Connection.Open()
cmd.ExecuteNonQuery()
cmd.Connection.Close()
VARFÖR fUNGERAR DET I QUERY ANALYSER MEN EJ FRÅN VB.NETSv: KNEPIGT FEL I STORED PROCEDUREStoo many arguments specified. VARFÖR fUNGERAR
..tyvärr kan jag inte svara på din fråga..Sv:KNEPIGT FEL I STORED PROCEDUREStoo many arguments specified. VARFÖR fUNGERAR
cn.ConnectionString = "Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Trading;Data Source=SMO;Packet Size=4096;Workstation ID=SMO"
Dim cmd As New SqlCommand
cmd.CommandText = NRA & "EB1" & objtidp & "M" & objs
Dim OPAR1 As SqlParameter = cmd.Parameters.Add("@H", SqlDbType.Decimal)
OPAR1.Value = h
Dim OPAR2 As SqlParameter = cmd.Parameters.Add("@L", SqlDbType.Decimal)
OPAR2.Value = l
Dim OPAR3 As SqlParameter = cmd.Parameters.Add("@C", SqlDbType.Decimal)
OPAR3.Value = cl
cmd.Connection = cn
cmd.CommandType = CommandType.StoredProcedure
cmd.Connection.Open()
cmd.ExecuteNonQuery()
cmd.Connection.Close()