Clear Steps to use this product in VS2005 Please

Posts   
 
    
tlf
User
Posts: 8
Joined: 12-Nov-2006
# Posted on: 27-Jan-2007 03:44:43   

Hello,

I am using SQL2000. I have created a LLBL Adapter project and generated it. Now, I would like to use the entities in a VS2005 project -- both windows front end and Web front end.

I have created a project in VS2005. I have added both of the LLBL projects that I generated, to the project. I have also added a website.

When I open the default.aspx page on the website, I have gone to the tools and added LLBLGenProDataSource2 to the toolbox.

After I dragged the LLBLGenProDataSource2 to the default.aspx page, I tried to configure the data source. The only dropdown that has anything in it is the Container type. I have chosen EntityCollection.

Since there is nothing in the DataAccessAdapter to use, I changed the LivePersistence property of the DataSourceControl to false (according to the instructions on the form). Nothing ... No change in behavior.

I am looking at the page for Databinding with ASP.NET Adapter in the help file and find the instructions very limited.

I would really appreciate it if someone would either point me to the correct page in the help file where detailed instructions are provided for using LLBLGen pro with VS2005, or if someone would be kind enough to write some fairly detailed instructions on how to use the product with VS2005.

I hear all of the great things LLBLGen can do, unfortunately, I can not get off first base. I would really appreciate clearer instructions.

Thanks for your help,

TFISHER

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 27-Jan-2007 08:57:10   

tlf wrote:

Hello,

I am using SQL2000. I have created a LLBL Adapter project and generated it. Now, I would like to use the entities in a VS2005 project -- both windows front end and Web front end.

I have created a project in VS2005. I have added both of the LLBL projects that I generated, to the project. I have also added a website.

When I open the default.aspx page on the website, I have gone to the tools and added LLBLGenProDataSource2 to the toolbox.

Just to be clear: you're using adapter? Because selfservicing uses LLBLGenProDataSource and adapter uses LLBLGenProDataSource2.

There are a couple of important steps to follow, and you might run into a glitch of vs.net 2005 where it can't find types/assemblies (this issue seems to be fixed in SP1 for vs.net 2005 btw).

First of all, is that your website project has to reference the generated code projects. This is essential. If you use a webSITE project (the project style vs.net 2005 initially ships with, thus the diskbased one), you don't need to reference the ormsupportclasses dll. If you use a webAPPLICATION project (which is an add-on project type for vs.net, and which is shipped with VS.NET 2005 sp1) you have to reference the ormsupportclasses dll.

Though this will be told to you by vs.net anyway, so that's not a big deal.

BUILD the solution, so the web project knows the generated code types.

Now open a webform and start creating it with the datasourcecontrol.

After I dragged the LLBLGenProDataSource2 to the default.aspx page, I tried to configure the data source. The only dropdown that has anything in it is the Container type. I have chosen EntityCollection.

This is one of the things that you might run into. If you haven't build the whole solution, the webapplication doesn't know any type in the generated code. So vs.net can't show you anything.

If you have build the solution and this problem still persists, you run into one of the most annoying bugs in vs.net and which was apparently solved in sp1 (I haven't seen this since) . So either way, try to install sp1 for vs.net 2005, OR: - close all webforms - close vs.net - reopen vs.net - BUILD - open form in HTML view - switch view of form to design.

This isn't something we can fix unfortunately, and other datasourcecontrol vendors have the same issue (Rocky Lhotka once blogged about it that his csladatasourcecontrol had the same problem). I know it's frustrating that vs.net 2005 does this, and trust me, it's even more frustrating to first spend 2 months writing a datasourcecontrol without any documentation to fall back on, and then find out that vs.net has a glorious bug which forces you to explain to a lot of people it's not your fault nothing shows up in the dropdown lists..

So until you have some values in the dropdowns, there's little you can do with the datasourcecontrol at design time.

Since there is nothing in the DataAccessAdapter to use, I changed the LivePersistence property of the DataSourceControl to false (according to the instructions on the form). Nothing ... No change in behavior.

I am looking at the page for Databinding with ASP.NET Adapter in the help file and find the instructions very limited.

There's not much more to tell really, all options are in the property grid. But again, if the dropdown lists don't show anything, the control can't be used.

Also please take a look at HnD's sourcecode, our example app for ASP.NET: http://www.llblgen.com/HnD It's selfservicing but works the same as adapter (no lazy loading etc.). Especially check the GUI\Admin\ManageSupportQueues.aspx page for a datasourcecontrol example.

Frans Bouma | Lead developer LLBLGen Pro
tlf
User
Posts: 8
Joined: 12-Nov-2006
# Posted on: 27-Jan-2007 12:48:06   

Hello,

I finally have been able to get the dropdowns to work. In addition to adding the Adapter projects to the overall project, I had to add them to the References of the Website. Sorry, but I do not see this step in the instructions. If it is in the help file, please tell me where to look.

I have selected Entity, the DataAccessAdapter and the EmployeeEntityFactory. I have added a gridview, selected the DataSource, enabled editing, paging, etc. I have saved and have rebuilt the solution.

Now, I try to run the webpage with the grid and datasource on it and get an error telling me the ConnectionString property has not been initialized.

Is there somewhere in the help file to look for this error? or how to set up the connection string?

It would be really helpful to me if you would provide a step-by-step list of steps to perform in order to get this thing to work properly.

Thanks,

TFISHER

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39588
Joined: 17-Aug-2003
# Posted on: 27-Jan-2007 14:08:42   

tlf wrote:

Hello,

I finally have been able to get the dropdowns to work. In addition to adding the Adapter projects to the overall project, I had to add them to the References of the Website. Sorry, but I do not see this step in the instructions. If it is in the help file, please tell me where to look.

Erm... you have project A in the solution and the generated code projects, it's ALWAYS necessary to reference the generated code projects in project A, no matter what that is: console app, webapp, winforms app... simple_smile

Isn't it so that in winforms applications you have to do this as well? simple_smile

In webapps, microsoft made it a bit more obscure, as you have to go into properties -> reference to add a reference, though it's not automatic.

I have selected Entity, the DataAccessAdapter and the EmployeeEntityFactory. I have added a gridview, selected the DataSource, enabled editing, paging, etc. I have saved and have rebuilt the solution.

Now, I try to run the webpage with the grid and datasource on it and get an error telling me the ConnectionString property has not been initialized. Is there somewhere in the help file to look for this error? or how to set up the connection string?

Yes, in the web.config, it's the same as in app.config in winforms, you just have to specify an appSettings section, as the web.config file of HnD for example, or as described in using the generated code -> compiling the code -> using the compiled assembly

It would be really helpful to me if you would provide a step-by-step list of steps to perform in order to get this thing to work properly.

It's as with winforms or a console app: you have to reference the generated code projects from your own project, and in the .config file of your application, you have to specify the appsettings element with the connection string as generated in the dbspecific project.

In webapps that's not different than in winforms applications. You got it working with your previous projects, so it should be the same with this project as well.

Frans Bouma | Lead developer LLBLGen Pro
tlf
User
Posts: 8
Joined: 12-Nov-2006
# Posted on: 27-Jan-2007 17:56:41   

Well,

I don't have any applications built with this product.

I tried to work with this product several months ago -- did not have much luck with it.

Now that I have some more time, I am trying again -- still no luck.

I wonder if there is anyone out there that can write some clear step-by-step instructions on the use of this product with VS2005?? I would be grateful for those instructions.

TFISHER

Chester
Support Team
Posts: 223
Joined: 15-Jul-2005