view raw
Rahman Jalayer Rahman Jalayer - 9 months ago 54 Question

How to use sqlparameter in

i have some codes in c# and want to convert to

codes in c#:

public Dataset ExecuteDataset(CommandType commandType, string commandText, SqlParameter[] commandParameters)

public DataSet ShowList()
DataSet ds = new DataSet();

ds = e.ExecuteDataset(CommandType.StoredProcedure, "PrcShowList", new SqlParameter[] ({new SqlParameter("@Id",Id) });

return ds;


how to convert this code to i am new in


I use this free online tool for conversion.

Which gives:

Public Function ExecuteDataset(commandType As CommandType, commandText As String, commandParameters As SqlParameter()) As Dataset

End Function

Public Function ShowList() As DataSet
    Dim ds As New DataSet()

    ds = e.ExecuteDataset(CommandType.StoredProcedure, "PrcShowList", New SqlParameter() {New SqlParameter("@Id", Id)})

    Return ds
End Function

'Service provided by Telerik (
'Conversion powered by NRefactory.
'Twitter: @telerik

Although i did have to fix a small typo first where the parameter array was created