This question is locked. New answers and comments are not allowed.
Hi,
i am using stored procedures in my application and if i call a specific stored procedure the results are not the same as IN SSMS.
The weird thing is that only specific columns are not returned.
This is my code
The obj-Variable contains the correct number of columns returned by the stored procedure, but they are always null.
This is the result if i call the stored procedure in query analyzer
This is what i get inside my application
Any help would be really appreciated.
Thank you.
i am using stored procedures in my application and if i call a specific stored procedure the results are not the same as IN SSMS.
The weird thing is that only specific columns are not returned.
This is my code
Public Shared Function spMEDIENSELEKTIONPREMIUM(ByVal scope As IObjectScope,ByVal iNPUTTABLE As String,ByVal mEDIENGATTUNGEN As String,ByVal sTREUARTEN As String,ByVal eRSCHEINRHYTHMEN As String,ByVal eRSCHEINTAGE As String,ByVal eRFAHRUNGSWERTE As String,ByVal rANG As Nullable(Of SByte)) As IQueryResult Dim query As IQuery = scope.GetSqlQuery("[sp_MEDIENSELEKTION_PREMIUM] ?,?,?,?,?,?,?", Nothing, "VARCHAR INPUTTABLE,VARCHAR MEDIENGATTUNGEN,VARCHAR STREUARTEN,VARCHAR ERSCHEINRHYTHMEN,VARCHAR ERSCHEINTAGE,VARCHAR ERFAHRUNGSWERTE,TINYINT RANG") Dim res As IQueryResult = query.Execute(New Object() {iNPUTTABLE, mEDIENGATTUNGEN, sTREUARTEN, eRSCHEINRHYTHMEN, eRSCHEINTAGE, eRFAHRUNGSWERTE, rANG}) Dim count As Integer = res.Count 'executes the query Return resEnd FunctionSelection = StoredProcedure.spMEDIENSELEKTIONPREMIUM(m_mcScope, InputTable, Chr(34) & MediaTypes & Chr(34), Chr(34) & DistributionTypes & Chr(34), AppearRhythms, AppearDays, ExperienceRatings, 1)Dim Results As New CollectionFor Each obj As Object In Selection str = "" For i As Integer = LBound(obj) To UBound(obj) If i <> 0 Then str &= obj(i) & "|" End If Next Results.Add(str, obj(0))NextThe obj-Variable contains the correct number of columns returned by the stored procedure, but they are always null.
This is the result if i call the stored procedure in query analyzer
ID MID MNAME
3741 576 Newspaper13826 4675 Newspaper2This is what i get inside my application
ID MID MNAME
3741 null null3826 null nullAny help would be really appreciated.
Thank you.