Ionix


Hi

I have done a SQL statement INSERT for my coding. The program compiled and run the insertion with no error occurred. But after the compilation I found out that my database is not populated at all.

I tried the data insertion using the manual query, and I work perfectly.

So the problem now is that I do not know why my codes did not insert the data into my database. Will like to get some advise. Thanks

My codes are pasted in http://www.pastebin.ca/320102
The Debug.Writeline in the code is in
http://www.pastebin.ca/320108


Thanks again.



Re: Problem with the SQL Insert with .CommandText() and .ExecuteNonQuery()

Figo Fei - MSFT


Hi,

Your thread seems to be more appropriate here and hope you find satisfactory answers.

Thank you for understanding







Re: Problem with the SQL Insert with .CommandText() and .ExecuteNonQuery()

Jens K. Suessmeyer

Hi,

start SQL Server profiler to see what ishappening behind the scenes and post back the printed results. Include the STMT events as well as exceptions.


HTH, Jens K. Suessmeyer.

---
http://www.sqlserver2005.de
---





Re: Problem with the SQL Insert with .CommandText() and .ExecuteNonQuery()

Ionix

Hi

I think I have found the problem the database connection i set to. The database in my project folder is the one that is appearing on my IDE's server explorer. But the program was actually inserting data to /bin/debug/database.mdf instead. That is the reason why I am unable to see the data in my database.

How can I make my debug binary point to the same working database instance, than to create mulitple copy of the database