Newbie - how do I get to the SQL statement behind a grid etc.

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
2/5/2011 11:32:16 AM
Gravatar
Total Posts 2

Newbie - how do I get to the SQL statement behind a grid etc.

I'm an old ANSI C coder, but new to Visual Studio Web Developer, ASPX, .NET etc.  My object oriented programming expreience is pretty much restricted to VB and VBA.

I am doing volunteer work for a Senior Citizen's club, porting the site from static HTML to CMS.  We have a mojoPortal site that is almost what we want, we'd just like to tweak a few things.  It is an MS SQL Server installation on a Windows 2008 Server Standard R2 running SQL Server 2008 R2.  This is my development server, it will not be the production server.  My server's name is  W8WMSDC1 which I put into the user.config file (see below)

First target task:  We would like to add these items to the MemberList page:

  •   MembershipDate   - not the same a the current "Joined Date"  I need to allow for NULL value as a person may be on waiting list.
  •   MembershipStatus - Member, Waiting List, Former Member, Honorary Member
  •   URL_thumbnail - We'd like to display thumbnail ( with link to full image and display ala Photo Gallery)
  •   URL_fullimage

I have populated the columns in the table using MS Access for now.  Ultimately will need web interface to maintain these items.  My initial task is to add these items to the grid that is displayed on the MemberList.aspx page.

What I've done so far...
a) Added fields to table Users and populated
b)  Installed MS VS Web Developer 2010 Express on my desktop - XP SP3 w/ .NET 4 etc.
c) downloaded and unpacked the source into folder C:\RMC on desktop
d) copied the user.config file from the server to desktop's C:\RMC\Web and in the MS SQL connect string replaced the
".\'  with '\\W8WMSDC1\'    Did not do anything with *.business.* as we aren't using them.
e) Started Web Developer, navigated to the mojoPortal.mssql.sln and loaded it.
f)  touched web.config to cause it to reload user.config
g) built solution.  0 errors, 20 warnings, all were about deprecated items which I presume I can ignore
h) examined MemberList.aspx - design view.  There are several things that it is complaining about.

Examining the source, I think that it is looking for rptUsers as a data source.  I presume that this is where it somehow grabs the data rows from SQL Server, but I can't find it.  I ran grep and found references in MemberList.*.* and MyPage.*.*

Questions:
1) Can I just work with the 'working' MS SQL database or must I build one on the development machine for development purposes and run IIS on the development machine?
2) How do I resolve the unresolved references on MemberList.aspx?  Perhaps answer to #1 above takes care of this?
3) How do I get at the SQL statement that gets my data stream?  I presume this is a property on perhaps a grid control?

Lastly - I am legally blind and unable to watch video clips/tutorials.  However I have screen reader application that does text-to-speech quite nicely, so if you can point me to text instructions that would be preferable.  Thanks!

 

2/6/2011 8:36:48 AM
Gravatar
Total Posts 18439

Re: Newbie - how do I get to the SQL statement behind a grid etc.

Hi Bruce,

I recommend reading all the developer documents and watching/listening to all the training videos to get up to speed with both C#/ASP.NET and mojoPortal. I understand about the difficulty for visual impairment, while we do have quite a few developer docs besides the videos, unfortunately I can't say that we have equivalent non-video documentation for all of it. While you won't be able to get the full benefit, I still think the audio portion of the videos may help some. Ultimately the mojoPortal source code is the best documentation. By studying how mojoPortal features are implemented you can learn how to do things in your own custom features.

The first thing I want to point out to you is that it is a really bad idea to modify mojoPortal source code. Doing that means you will not be able to upgrade without losing your customizations. mojoPortal is actively developed and you will want to be able to upgrade to get new features and bug fixes. The main benefit of working with the source code is for learning and code examples of how to do things.

If you see the code that gets the data for a grid, you can right click the method in VS and choose "Go To Definition" and it will take you to that method. However as mentioned you should not modify the code to meet your needs. You should find ways to keep all of your custom code separate in your own projects without modifying any mojoPortal code. So for example if you want to show extra stuff on the memberlist, you should not modify th emember list that comes with mojoPortal nor any underlying code. You could create your own custom member list page and you can use a post build event in your custom project to copy your memberlist page up to the web project overwriting the one that is included. This way at least you are able to upgrade but you will need to restore your customizations after upgrading. For the extra data you want to display you should make your own table not modify the included tables, you can use the UserID or UserGuid to relate your custom table to users and make your own methods to lookup users and join your custom table.

http://www.mojoportal.com/avoid-forking-the-code.aspx

http://www.mojoportal.com/developerdocs.aspx

http://www.mojoportal.com/developertrainingvideos.aspx

Also if possible I recommend get the full version of Visual Studio 2010 instead of the Express version. You may qualify to get it free via the Web Site Spark program from Microsoft.

Hope it helps,

Joe

2/6/2011 9:47:18 AM
Gravatar
Total Posts 2

Re: Newbie - how do I get to the SQL statement behind a grid etc.

Thank you Joe, yes it helps.   I'll crank up the videos and see what I can pick up from them and then search printed docs on your site or MSDN etc. for stuff I don't absorb.

While I didn't explicitly state it, yes I was intending to clone the MemberList to RMC_MemberList.  I hadn't thought about using a linked table for our additional columns, but understand and agree.  I'll make the change to support an equi-join  to RMC_Users using the GUID.

Upon reflection it occurs to me that I probably made a development environment error in that I pointed to the MS SQL database on the server rather than a not-yet-existing copy on the development machine.  I also must activate the IIS on the development machine rather than assume that my separate server is doing the work.  Essentially I want both the SQL Server and IIS on the development machine as I believe it to be the case that in development mode the IDE launches the local IIS with debugging hooks etc, and it in turns expects the database to be on 'localhost' and accessed by the IISUSER system account get at the tables.

I probably won't get to it until tomorrow evening - today I'm faced with picking Green Bay or Pittsburgh - tough choice as I have family ties to both - who do I want to irk?

 

 

 

 

 

 

 

You must sign in to post in the forums. This thread is closed to new posts.