Hi Scott.
It's been a while since my last post here, and I really stopped trying to use LINQ2SQL with Christoc's Module Templates. But now I'm back, and I stil can't figure it out!
Allow me to give a brief historic review of my experience creating modules: what I've been doing so far is creating a folder inside of Desktopmodules with the name of my company, and inside of it one folder for each module I made, and inside of each folder an .ascx file with its .ascx.vb associated file. And for the data connection I created a folder called App_Code, and inside of it I created a "LINQ2SQL Classes" set of files. To populate gridviews, combos, formviews, I just dropped a Linq2sqlDtasource on the .ascx and within it I chose the LINQ2SQL datacontext that is in the App_Code folder. And to Access the database from the .ascx.vb (codebehind) file, I created a datacontext type variable, and from it I reached tables, stored procedures, views, etc. in the database.
That's it. It Works nice, but I cannot create "true" modules, instalable .zip modules.
With Chirstoc's templates I can create those modules, which is great. But triying to use the same LINQ2SQL approach for databinding and data Access in general, is still impossible.
I've obtained curious results:
1- I added an App_Code to the Project (right click -> Add/Add ASP.net Folder/App_Code, and my LINQ2SQLDatasources on the .ascx files get the DataContext in them. BUT I cannot access the Datacontext from my code. :( -oh, and I must create an App_Code folder with a copy of the Datacontext files in it, on the DNN server.
2- If I create a LINQ2SQL datacontext in the root folder of the module, I can use it from my vb code file, but it won't appear on my LINQ2SQLDtasources!
I tried to use the partial class approach, but honestly, maybe I'm not that proficient in .NET and I couldn't do it.
BTW, I tried populating a gridview using a plain SQLDatasource, and it worked flawlesly. Why cannot one use that approach for module creation?
Thanks for your comments.