1

I am using a typed dataset (Devart.Data.SQLite) with SQLite in .net.

I have two separate databases, Master Parts List (MPL) and a Project DB (ProjDB). There could be many ProjDB's but there needs to be only 1 MPL, shared by everyone. The ProjDB will reference an PartID located in the MPL. I want to 'ATTACH' the MPL to my ProjDB in order to draw information from the MPL. I know the recommended course to have everything in the same database for data integrity, however the parts in the MPL will never be deleted. There will only be additions and slight text modifications. Also the MPL is large and I don't want to replicate it every project.

I can add two separate connections in the Datadesigner and created a relation allowing me to create a Master/detail (in separate grids) across the two databases. This fulfills most requirements, but I need to show a row with projDB and MPL data in the same row and the datadesigner will not let me do this.

I have only been able to 'ATTACH' using a 'ExecuteNonQuery' in an untyped dataset.

Should I ditch typed datasets and switch over to untyped?

  • Have you tried an expression column? – peterG Nov 19 '17 at 15:46
  • I tried that just before I posted. I created a "dummy" column on the table in the designer, but when I tried referencing the Master DB, it gave me an expression error. I tried to search for the proper formatting, but could only find math or concatenation of fields when dealing with an expression. – JoeRecursionJoe Nov 19 '17 at 16:34
  • The expression column syntax is [here](https://msdn.microsoft.com/en-us/library/system.data.datacolumn.expression(v=vs.110).aspx). Look about half way down. Also have you tried using a JOIN query in the dataset designer? See for isntance [this answer](https://stackoverflow.com/questions/11426929/can-we-use-join-for-two-different-database-tables) although I have no idea if it's possible with SQLite. Also as an aside your use of 'ATTACH' is misleading - it has a specific meaning which is different from the way you are using it here. – peterG Nov 19 '17 at 17:38
  • I know JOIN with a database qualifier works for SQL Server with two databases in the same instance, but In the data designer when you open a table configuration, it does not see the tables in the other SQLite connection. – JoeRecursionJoe Nov 20 '17 at 21:53

0 Answers0