Hi
That works perfect for me:
using System;
using System.Data;
using System.Data.SqlClient;
using NUnit.Framework;
namespace myNameSpace
{
[TestFixture]
public class TestCasting
{
[Test]
public void CastIDataParameter()
{
IDataParameter param = new SqlParameter("myParamName", true);
SqlParameter castedParam = (param as SqlParameter);
Assert.AreEqual("myParamName", castedParam.ParameterName);
Assert.AreEqual(true, castedParam.Value);
Assert.AreEqual("myParamName", param.ParameterName);
Assert.AreEqual(true, param.Value);
}
}
}
Greetings from Switzerland
Thomas