We have a windows forms data driven framework which has a powerfull really dynamic data layer. This data layer does not get the underlying databse structure by user but get only the connection string and creates the database structure runtime via related
objects. e.g.
myCompanySqlConnection mcsc = new myCompanySqlConnection("Server=.;db=db1");
mcsc.Tables["table1"].Fields["field1"].Name = "fieldOne";
//or even
mcsc.Tables.Add("newTable", "/*sql query to build table*/");
mcsc.TableProperties["newTable"].PersianName = "جدول جدید";
mcsc.Dispose();
//working with another
myCompanySqlConnection mcsc = new myCompanySqlConnection("Server=.;db=db2");
mcsc.Tables["table1"].Fields["field1"].Name = "fieldOne";
Now, in our framework migration to asp.net, we would like to reuse this independent data layer with Dynamic Data but unfortunately, it seems that Dynamic Data is not dynamic enough! In our framework, the user can create a database with some framework needed
tables and in addition his own tables. then user can run our framework on new database by passing ONLY the connection string then framework allows user to work with his own new tables, WITH NO NEED TO MAKE A DATA MODEL OR RE COMPILATION. BUT in asp.net Dynamic
Data, we have to create a new data model for each new database then mapping objects to it. n asp.net Dynamic Data, a created and compiled dynamic data can not run on a new database while our datalayer can run on new database and will fetch required info itself
via sql queries.
I hope I could descibe well the issue. Any one please have any idea or we should forget using Dynamic Data?
Sorry this is not easily possible the DB must exist at runtime and connot be created on th fly, also you may not easily change the DB at runtime as this is loaded at application startup, not at session.
See my blog C# Bits | Twitter @sjnaughton Always seeking an elegant solution.
Marked as answer by Yasser B Zamani on Apr 17, 2012 03:36 AM
Sorry this is not easily possible the DB must exist at runtime and connot be created on th fly, also you may not easily change the DB at runtime as this is loaded at application startup, not at session.
Yasser B Zam...
Member
91 Points
38 Posts
DYNAMIC DATA MODEL
Apr 16, 2012 09:49 AM|LINK
Hi,
We have a windows forms data driven framework which has a powerfull really dynamic data layer. This data layer does not get the underlying databse structure by user but get only the connection string and creates the database structure runtime via related objects. e.g.
myCompanySqlConnection mcsc = new myCompanySqlConnection("Server=.;db=db1"); mcsc.Tables["table1"].Fields["field1"].Name = "fieldOne"; //or even mcsc.Tables.Add("newTable", "/*sql query to build table*/"); mcsc.TableProperties["newTable"].PersianName = "جدول جدید"; mcsc.Dispose(); //working with another myCompanySqlConnection mcsc = new myCompanySqlConnection("Server=.;db=db2"); mcsc.Tables["table1"].Fields["field1"].Name = "fieldOne";Now, in our framework migration to asp.net, we would like to reuse this independent data layer with Dynamic Data but unfortunately, it seems that Dynamic Data is not dynamic enough! In our framework, the user can create a database with some framework needed tables and in addition his own tables. then user can run our framework on new database by passing ONLY the connection string then framework allows user to work with his own new tables, WITH NO NEED TO MAKE A DATA MODEL OR RE COMPILATION. BUT in asp.net Dynamic Data, we have to create a new data model for each new database then mapping objects to it. n asp.net Dynamic Data, a created and compiled dynamic data can not run on a new database while our datalayer can run on new database and will fetch required info itself via sql queries.
I hope I could descibe well the issue. Any one please have any idea or we should forget using Dynamic Data?
Thanks in advance!
sjnaughton
All-Star
27308 Points
5458 Posts
MVP
Re: DYNAMIC DATA MODEL
Apr 16, 2012 01:54 PM|LINK
Sorry this is not easily possible the DB must exist at runtime and connot be created on th fly, also you may not easily change the DB at runtime as this is loaded at application startup, not at session.
Always seeking an elegant solution.
Yasser B Zam...
Member
91 Points
38 Posts
Re: DYNAMIC DATA MODEL
Apr 17, 2012 03:38 AM|LINK
Thanks Stephen, I guessed, but now I'm sure:)