Failed To Convert Parameter Value From A String To A Int32

后端 未结 3 1868
我在风中等你
我在风中等你 2021-01-19 00:35

I am currently trying to complete a transaction for a web based app, however;

Failed To Convert Parameter Value From A String To A Int32

3条回答
  •  执笔经年
    2021-01-19 00:57

    One of the inputs is a string, check the declarations for:

    storeCode
    employeeId
    itemListNoId
    

    I imagine storeCode is a string. You can fix this by parsing it as an Int:

    command.Parameters.Add("@storeCode", SqlDbType.Int).Value = int.Parse(storeCode);
    

    However this will cause problems if storeCode is ever no a parasable Int.

提交回复
热议问题