Hello everyone, I have this function but for some reasons, the stored procedure keeps complaining that it could not find the parameters. Here is the code:
Public Function GetData(ByVal spName As String, ByVal dt As DataTable) As DataSet
Dim cnn As SqlConnection
Dim conString As String = System.Configuration.ConfigurationManager.ConnectionStrings("ConnectionString").ToString
cnn = New SqlConnection(conString)
Dim cmd As New SqlCommand(spName, cnn)
cmd.CommandType = CommandType.StoredProcedure
Dim da As New SqlDataAdapter(cmd)
Dim ds As New DataSet()
If dt IsNot Nothing Then
Dim parameters As List(Of SqlParameter) = New List(Of SqlParameter)
For Each row In dt.Rows
parameters.Add(New SqlParameter(row("ParamName"), SqlDbType.VarChar, 80, row("ParamValue")))
Next
da.SelectCommand.Para ...
Go to the complete details ...