Trying to execute a stored procedure and get the results back
In vb.net I would just execute..
The above just returns NULL. Do I have to execute it as if I was on SQL SMS.. to get a results?
B4X:
sSQL = "EXECUTE [dbo].[add_person] " & _
"NULL" & _
",NULL" & _
",'" & sEntID & "'" & _
",'" & sPracID & "'" & _
",NULL" & _
",'" & sLastN & "'" & _
",'" & sFirstN & "'" & _
",0"
Dim iR as Int = 0
iR = sqlMS.ExecQuerySingleResult(sSQL)
In vb.net I would just execute..
B4X:
[/COLOR][/FONT]
[COLOR=rgb(20, 20, 20)] sSQL = "EXECUTE [dbo].[add_person] " & _
"NULL" & _
",NULL" & _
",'" & sEntID & "'" & _
",'" & sPracID & "'" & _
",NULL" & _
",'" & sLastN & "'" & _
",'" & sFirstN & "'" & _
",0"
[/COLOR][/LEFT]
command = New SqlCommand(sSQL, conn)
[LEFT][FONT=verdana][COLOR=rgb(20, 20, 20)] iSQLStatus = command.ExecuteScalar()
The above just returns NULL. Do I have to execute it as if I was on SQL SMS.. to get a results?
B4X:
sSQL = "Declare @i int, @s varchar(max) ” & _
"EXECUTE [dbo].[add_person] " & _
"@i output" & _
",@s output" & _
",'" & sEntID & "'" & _
",'" & sPracID & "'" & _
",NULL" & _
",'" & sLastN & "'" & _
",'" & sFirstN & "'" & _
",0" & _
"Select @i as [cd], @s as [des]"
Dim iR as Int = 0
iR = sqlMS.ExecQuery(sSQL)
Do While rs.NextRow
log(rs.GetString("cd"))
log(rs.GetString("des"))
Loop
rs.Close