質問のタイトルの言い回しが正確にわかりませんでした。
挿入を行うストアドプロシージャのSQLパラメータを設定するこのコードブロックがあります。
Dim sproc As StoredProcedure = New StoredProcedure("UsersInsert2", DataAccessConfiguration)
sproc.AddInput("@ID", SqlDbType.NVarChar, 10, entity.UserId)
sproc.AddInput("@PCode", SqlDbType.SmallInt, entity.PriviledgeCode)
sproc.AddInput("@Pwd", SqlDbType.NVarChar, 10, entity.Password.ToString())
sproc.AddInput("@Lang", SqlDbType.NVarChar, 1, entity.DefaultLanguage)
sproc.AddInput("@Name", SqlDbType.NVarChar, 40, entity.UserName)
sproc.AddInput("@Notice", SqlDbType.TinyInt, entity.SaveNotice)
sproc.AddInput("@CreatedBy", SqlDbType.VarChar, 50,CurrentUserCredentials.UserName)
SSMSでストアドプロシージャをテストしましたが、動作します。問題は、アプリケーションから呼び出そうとしたときです。失敗します。@@ rowcount=-1。私はデータベースからエラーコードを返そうとしました...サイコロはありません。-1として戻ってきます
実行されるものは次のようになります
sproc = {EXEC UsersInsert2 @ID=ruxtest7, @PCode=0, @Pwd=1234, @Lang=E, @Name=ruxpint, @Notice=1, @CreatedBy=ruxpint}
問題が何であるかについて何か考えはありますか?私はこのコードを数回再利用しました。唯一の違いは、NVarCharとvb.netを使用していることです。
ありがとう。
TR