What is D2.Table? Also what is the _fileName referred to in the code?
And finally ... what platform? Mono or Windows? I'm just wondering about the use of slashes instead of backslashes in the attach filename. Oh, and http://sqlite.phxsoftware.com is more suited for handling .Net-related questions on the SQLite engine. -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Carlton Guc Sent: Monday, June 29, 2009 9:54 PM To: [email protected] Subject: [sqlite] ATTACH Database ATTACH database I have a unique problem where ATTACH database seems to work fine when I'm using a GUI tool, however when I pass the SQL string to the SQLite engine using SqLiteCommand under .NET, it doesn't seem to work. I get an error saying that D2.Table is not found. SQL String: ATTACH DATABASE 'F:/Users/name/Documents/ShowBuilder6/Database/2.sbx' AS XYZ; SELECT * from [EquipmentCatalog] union select * from XYZ.EquipmentCatalog Code: // SQLite database builder using (SQLiteConnection cn = new SQLiteConnection(SBConnection.GetDatabaseConnection(_fileName))) { cn.Open(); SQLiteCommand cmd; ResourceManager resourceManager = new ResourceManager("ShowBuilder6.Library.Properties.StoredProcedures", Assembly.GetExecutingAssembly()); for (int i = versions.IndexOf(_currentVersion); i < versions.Count - 1; i++) { try { cmd = new SQLiteCommand(resourceManager.GetString(/// the above Attach string, cn); cmd.ExecuteNonQuery(); } catch { } } } Does anyone have the "ATTACH" command working from a .NET interface? Again, I can get it to work using SQLite Developer, but doesn't seem to work in code. Thoughts? Carlton SR _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

