Ok lest try this again without gmail sending it prematurly.

I've got a demo application that has this table in a SQL 2000 database.


CREATE TABLE [dbo].[Fruit](
    [id_fruit] [int] IDENTITY(1,1) NOT NULL,
    [name] [nvarchar](255) NULL
) ON [PRIMARY]

I run this code against it.

  public IFruit GetFruitByName(IDbTransaction transaction, string name)
        {
            string sql = "select top 1 * from fruit where name = @name";
            List<IDbDataParameter> parameters = new
List<IDbDataParameter>();
            parameters.Add(Database.
>
> CreateParameter("@name", name));
>             FruitBuilder builder = new FruitBuilder();
>             using (IDataReader reader = Database.ExecuteReader(transaction,
> sql, CommandType.Text, parameters, CommandBehavior.SingleRow))
>             {
>                 IFruit fruit = builder.BuildOne(reader);
>                 return fruit;
>             }
>         }
>
There is nothing really strange in the calls but what I am getting is, the
id_fruit  column in the Select returned is returned to Ado.Net (3.5) as a
Decimal type and not an integer.

I've tried searching, and can't find anything to suggest why, any Ideas?

grazie mille

Davy,


"Always code as if the guy who ends up maintaining your code will be a
violent psychopath who knows where you live."
- Martin Golding

Reply via email to