単純なストアド プロシージャ (MyTable から名前、ID を選択) があり、それを C# (または VB.NET) から呼び出してデータセットを作成したいと考えています。
これが私のコードです:
Public Class PaymentDataAccess
    Public Function GetPaymentData() As DataSet
        Dim cn As New SqlClient.SqlConnection
        cn.ConnectionString = "Data Source=WORK-HP\BTFSERVER1;Initial Catalog=PaymentReminder;Integrated Security=True"
        Dim Cmd As New SqlCommand("GetPaymentData", cn)
        Cmd.CommandType = CommandType.StoredProcedure
        Dim sa As New SqlDataAdapter(Cmd)
        cn.Open()
        Dim ds As DataSet = Nothing
        Try
            sa.Fill(ds)
        Catch ex As Exception
            Dim i As Integer = 7
        End Try
        Return ds
    End Function
End Class
で例外が発生していますsa.Fill(ds)
{"Value cannot be null.
Parameter name: dataSet"}
    System.ArgumentNullException: {"Value cannot be null.
Parameter name: dataSet"}
これが私のストアドプロシージャです:
USE [PaymentReminder]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[GetPaymentData] 
AS
BEGIN
    SET NOCOUNT ON;   
    SELECT * from Payments
END