Hi, i just want to ask why this error mean?

InvalidOperationException was unhandled by user code

The provider could not determine the String value. For example, the row was just created, the default for the String column was not available, and the consumer had not yet set a new String value

hope to have some sharing if u all had experienced this n how to handle?

7 Years
Discussion Span
Last Post by JJCollins

it would be easier to verify what gone wrong if you post some snippet of your codes


what do you mean regarding " executed outside of a try catch structure"

This means that a SQL Command was executed outside of a try catch structure and got an error.


... so you created a row, didnt set a default value for the columns, and a consumer pulled the row from the database?

i dont really know what you mean

but if im right, you could possible do these two things:

set your default values in your database, ex. string is '' double is 0.0 int is 0 etc.

in your .net code add .tostring to the end of your column retrieve.


i dont know


If you could post a snippet of your code, that would be helpful :)

Also, if you're using SQL Server 2005, try running a trace on the database to see what its actually trying to execute (if anything at all).

It's very useful for correcting syntax problems etc.


this is my code

SELECT Referential.StockCode AS [Stock Code], Referential.StockLongName AS [PLC Name], Referential.StockShortName AS [PLC Short Name], Referential.Sector, Referential.SubSector AS [Sub Sector], Referential.Board, MI2006.[Movement in Inventory] AS 2006, MI2007.[Movement in Inventory] AS 2007, MI2008.[Movement in Inventory] AS 2008, MI2009.[Movement in Inventory] AS 2009, MI2010.[Movement in Inventory] AS 2010
FROM MI2010 INNER JOIN (MI2009 INNER JOIN (MI2008 INNER JOIN (MI2007 INNER JOIN (MI2006 INNER JOIN Referential ON MI2006.[Stock Code]=Referential.StockCode) ON MI2007.[Stock Code]=Referential.StockCode) ON MI2008.[Stock Code]=Referential.StockCode) ON MI2009.[Stock Code]=Referential.StockCode) ON MI2010.[Stock Code]=Referential.StockCode;

it would be easier to verify what gone wrong if you post some snippet of your codes

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.