0

I working on a database migration (from Oracle to SQL Server) and in this context, I need to change the DAL layer of an ASP.NET project. Part of this is finding the SQL Server equivalent of the class OracleParameter (From Oracle.DataAccess.dll).

So I would like to know which class I have to use, is it DbParameter or another one?

1
  • 3
    What does OracleParameter inherit from or implement? DbParameter? Then wouldn't it make sense there's an equivalent class in the SQL Server libraries that also inherits from that, and probably has "parameter" in the name? And where does one look for information about the libraries that come with .NET? The documentation! Commented Apr 25, 2017 at 13:13

1 Answer 1

1

Best to use:

SqlParameter

Eg:

var parameter = new SqlParameter();
            parameter.ParameterName = "@paramName";
            parameter.Direction = ParameterDirection.Input;
            parameter.SqlDbType = SqlDbType.Int;
            //parameter.IsNullable = true;
            parameter.Value = DaysInStock;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.