Could you give more details on the exception that you are getting? Is it coming from POCO or from the DB?
The code appears lifted straight from the POCO example book - the only difference is that you use an int, while they use a string. Assuming that their example works, and that you also use SQLite, there's only a small number of places where you could get an error. First thing I would try is specifying the list of column names: INSERT INTO TableName (myIntColumn) VALUES(:size): the single-column syntax looks suspicious. Then I'd look at the error coming back, and try to decipher it.
I want to create the existing sql2000 DTS in sql 2008, i installed sql2000 backward compatibility. i can open the DTS in sql2008 and save as the location sql server. It is saving in sql2008 and when i open the dts in the popup window asking to select the version, but i can't see any version in the popup window.how can i sort this issue.
name and key are inserted by user. Now whenever i am inserting new value, I need to check whelther I have that key exists or not. If yes, do nothing and if no, insert it. I know how to do it in dot net page but can I do this in sql query itself ? If yes, can anyone please help me..
IF NOT EXISTS (SELECT DISTINCT keyname FROM <table_name>)
As an aside: this may not be the case because I can only see two rows of sample data, but if the [keyname] value is a concatenation of [name] + [id] and [id] is an identity column, then you should always have a unique value in [keyname].
If uncrush is right then one has to ask why you are creating the KeyName field, it is redundant.
When I have to check for existing keys, I return the record instead of using exists, then test if I got a record, that way I have all the information about the record. I always put this type of work into a stored procedure that returns the record, the UI may not even know if the records was inserted ot not.
Never underestimate the power of human stupidity
Again depending upon the database and how the constraint operation is implemented, there may also be performance gains by using the constraint instead of coding it into a program. But your mileage may vary extensively.
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]