ParameterOut("ProductName", DataTypes.String,20) bug?

May 5, 2012 at 8:57 AM
Edited May 5, 2012 at 8:57 AM

System.InvalidOperationException : String[1]: Size=0

 

ActionsHandler.cs

line 117
fixed bug
_data.Command.Parameter(parameter.ParameterName, parameter.Value, parameter.DataTypes, parameter.Direction,size);

Coordinator
May 8, 2012 at 3:03 PM

What database do you use and what is your code? I just tried the following and it works with MS SQL:

[TestMethod]
public void Test()
{
	var command = TestHelper.Context().Sql("select top 1 @CategoryName = Name from Category")
										.ParameterOut("CategoryName", DataTypes.String, 50);
	command.Execute();

	var categoryName = command.ParameterValue<string>("CategoryName");

	Assert.IsFalse(string.IsNullOrEmpty(categoryName));
}

 

May 12, 2012 at 1:32 PM

 

var builder = repository.IContext.Sql("select @mid=mid from CustomerExtend where CustomerExtendID=21 ")
                .ParameterOut("mid"DataTypes.String, 20);
            builder.Execute();
            string str = builder.ParameterValue<string>("mid");
            Console.WriteLine(str);
Test Sql outParameter is right

Test Proc OutParamete is Bug
 IStoredProcedureBuilder builder = repository.IContext.StoredProcedure("TestProcParam")
                .Parameter("ProductID", 6)
                .ParameterOut("ProductName"DataTypes.String,20)

Coordinator
May 13, 2012 at 9:10 PM

Thanks, I have checked in a fix for it now but not made a build yet.