Proof that anyone can do it RSS 2.0
 Monday, March 12, 2007

I had a chance today to try out the Rainbow Portal 2.0 Beta.  So far, I'm pretty happy with it.  Of course, I struggled with the a checkout of the dev code for a while because I don't have Visual Studio .NET 2005, but once I restarted with a download of the zipped application, the installation went OK. 

The only problem I encountered during setup was a Configuration Error (see below):

Configuration Error !

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Unrecognized attribute 'xmlns'.

It turns out this is a problem of IIS trying to make the application use the .NET 1.1 framework.  It can be forced to use the 2.0 framework by changing the application's ASP.NET settings (In IIS Manager, right click your Rainbow application, Properties, ASP.NET; then choose the .NET 2.0xxxx framework). 

I even had a go at converting one of my more simple custom modules from Rainbow 1.1 to 2.0.  It was pretty painless too...

  • Open the module's csproj file in C# 2005
  • Run the conversion in C# 2005 to convert the project to .NET 2.0
  • Remove the references to Rainbow, Rainbow.Settings, and Esperantus DLL's
  • Add a reference to Rainbow.Framework.Core.DLL
  • Build, and start troubleshooting code issues (mostly namespace issues in my experience)
  • Once those issues are out, you add the module to the portal just as in Rainbow 1.1.
Monday, March 12, 2007 2:09:13 PM UTC  #    -
.NET | Rainbow Portal
 Thursday, July 28, 2005

I won't be surprised if someone can look at this and point out the problem right away, but I'm also ashamed to say how long I've been looking at it and trying to make it work...

private void Page_Load(object sender, System.EventArgs e) { 
  DataTable dt = new DataTable(); 
  dt.Columns.Add(new DataColumn("id",typeof(int))); 
  dt.Columns.Add(new DataColumn("name",typeof(string))); 
  
  DataRow dr = dt.NewRow(); 
  dr["id"] = 6; 
  dr["name"] = "City1"; 
  dt.Rows.Add(dr); 
  
  dr = dt.NewRow(); 
  dr["id"] = 7; 
  dr["name"] = "City2"; 
  dt.Rows.Add(dr); 

  this.ddLabList.DataSource = dt;      
  this.ddLabList.DataTextField = "name"; 
  this.ddLabList.DataValueField = "id"; this.ddLabList.DataBind(); 
}

The this.ddLabList.DataSource = dt; line gives an 'Object reference not set to an instance of an object' error.

Help!

Thursday, July 28, 2005 9:23:08 PM UTC  #    -
.NET | Programming
 Wednesday, June 29, 2005

It took a while for me to find enough examples to put together a method that will calculate the distance between two GPS points (using C#), so I thought I'd post my end product in the hopes it will shorten someone else's search.  Credits to 'The Math Forum' for the formula (http://mathforum.org/library/drmath/view/51879.html)

The code looks terrible in a browser, so I've attached it as a text file. DistLatLong.txt (1.54 KB)

Wednesday, June 29, 2005 5:22:30 PM UTC  #    -
.NET | Programming
 Wednesday, March 02, 2005

On an ASP.NET page with a couple DropDownLists, this problem surfaced. 

When the page is called, it tries (unsuccessfully) to select the appropriate item in the DropDown, based on data retrieved from the database.  The reported error is “A dropdown list cannot have multiple items selected“, even though I'm only making one selection. 

Most of the offerings I found on the Internet said that one or the other of these selection methods must be used.

[YourDropDownName].Items.FindByValue([YourDataFromDataBase]).Selected = true;
ListItem objItem = [YourDropDownName].Items.FindByValue([YourDataFromDataBase]);
[YourDropDownName].SelectedIndex = [YourDropDownName].Items.IndexOf(objItem);

I think both of them are OK to use.

The solution is to call the ClearSelection() method of the DropDownlist immeidately before selecting the value for it.  I found it here, at the very bottom of the post.  I never had to do that before, but it works!

Wednesday, March 02, 2005 4:51:48 PM UTC  #    -
.NET | Programming
 Friday, January 28, 2005

If I have a Strongly Typed DataSet that Visual Studio 2003 created for me, I (think I) should be able to do the following:

Given a Strongly Typed DataSet created with a Table named 'Names', which has two columns named 'FirstName' and 'LastName'...

dsContacts ds = new dsContacts();
DataRow dr = ds.Names.NewRow();
dr.FirstName = “John”;
dr.LastName = “Bowen”;

The problem I'm seeing is that Intellisense doesn't make the columns' names (FirstName, LastName) available.  In fact, I can't figure out ANY way to list columns for the DataRow dr

According to the Microsoft examples listed here and here, this sure seems like it should work...?

Friday, January 28, 2005 6:31:20 PM UTC  #    -
.NET | Programming
 Wednesday, December 29, 2004

Whenever I minimize my Visual Studio.Net 2003 window (the IDE window itself), I lose the ability to restore it...when I try, I get this view:

I can close it by hitting the close button in the control box (the red X).  I can then re-open it immediately, and it will work fine until it gets minimized the next time.

I know there are at least two people that read this blog :)...have either of you seen this before?

[edit 2005 Jan 17]After installing a new monitor (at a much higher resolution), this problem has gone away.  Maybe the resolution settings on my old monitor were messing up Windows' ability to repaint the VS window?[/edit]

Wednesday, December 29, 2004 7:01:59 PM UTC  #    -
.NET | Troubleshooting
 Tuesday, June 01, 2004

A current Windows Forms project of mine requires the caching of a fair amount of data.  Specifically, I want to store, in memory, on the client, a selection of XML data.  When it's done, this should behave something like ASP.NET's session object...so I'll have access to user information and preferences without having to hit the data source every time to get it. 

It's no problem to instantiate a class that retrieves and holds this information, but making that information available to other forms in the application (without again reloading an instance of the class and re-retrieving the data) is escaping me.  I explored Microsoft's Caching Application Block, and while it appears to offer the kind of behavior I'm after, it's a bit more complicated than I need (and depends heavily on SQL Server...I want to avoid that). 

Anyone have any suggestions out there?

Tuesday, June 01, 2004 8:07:44 PM UTC  #    -
.NET | XML
 Saturday, April 03, 2004

I've noticed that sometimes Visual Studio .NET 2002 hangs when I try to delete a file or files from the 'Solution Explorer'.  It just gets stuck on 'deleting file' dialog, and I have to close it with the task manager. 

Is anyone else seeing this, or am I just really lucky?

Saturday, April 03, 2004 1:35:55 AM UTC  #    -
.NET
 Tuesday, March 16, 2004

Plagued by yet another weird error...

Unable to create the web project “myProject”.  Unable to validate that the file path ‘c:\inetpub\wwwroot\myProject’ matches the URL path ‘http://localhost/myProject’.  A connection with the server could not be established.

I started getting this error any time I tried to open a web project in Visual Studio .NET...even projects I had opened successfully before.  In searching around, someone suggested a firewall may be to blame.  I turned off McAfee Firewall, and presto, it works fine.  Who needs protection, anyway?

Tuesday, March 16, 2004 3:27:27 AM UTC  #    -
.NET | WorkArounds
 Friday, March 12, 2004

Jeremy took pity on me and had a glance at a sample project I was using to test eXist with SOAP.  It seems Visual Studio .NET's 'Add Web Reference' Wizard wasn't setting up the proxy class for the web service correctly...

The web services are at http://localhost:8080/exist/etc... but VS.NET set up the proxy classes to use http://localhost/exist/etc... Manually adding the ':8080' to the web references' server name completely resolves the connection problems I was having

 

Friday, March 12, 2004 2:57:34 PM UTC  #    -
.NET | eXist

I am working on a project that requires importing a large amount of data from 'text data files' that were originally created with QuickBasic (in the 1980's).  One (not-so-quick) lesson I've just learned...that old text isn't written with ISO, UTF, or even ASCII encoding.  It's windows-1252. 

The problem showed up when trying to convert a two-bit string into an integer (the pointer to a related record) with the CVI() function.  Those funny little non-usual characters don't come through correctly with any other code page...

With a simple line:

Encoding encoding = Encoding.GetEncoding(1252);

Everything works. 

Friday, March 12, 2004 2:43:54 PM UTC  #    -
.NET | QuickBasic
 Saturday, March 06, 2004

I ran across this great article that gives a quick, clean example of how to export a web page's DataSet to Excel.  What's nice is that this example doesn't use a second web form for the export...it just re-uses the Response object in the current form.  Very handy!

http://www.dotnetjohn.com/articles/articleid36.aspx

Saturday, March 06, 2004 6:27:00 PM UTC  #    -
.NET
 Friday, February 27, 2004

I'm running into weird behavior in the ASP.NET DataGrid's ItemTemplate element.  Specifically, for an asp:HyperLink, the below code breaks...

<asp:HyperLink Runat="server" Target="_blank" 
NavigateUrl='http://myserver/recorddetail.asp?recnum=
<%# Container.DataItem("recnum")%>'>
<%# DataBinder.Eval(Container.DataItem,"recnum")%>
</asp:HyperLink>

The (HTML) output in the DataGrid looks like: 

 <A href="http://myserver/recorddetail.asp?recnum=<%# Container.DataItem("recnum")%>0400123</A>

Not exactly what I'm after...I've tried a number of variations, and any articles I've found online give examples that look just like mine.   

Friday, February 27, 2004 3:39:58 PM UTC  #    -
.NET
 Wednesday, February 25, 2004

Since I started using Visual Studio .NET, I've noticed that occasionally the 'Properties' window will not appear (when it is set to 'auto-hide') , even when you click 'Properties' for a control or hover over the collapsed Properties window icon on the right side (default location, anyway). 

I finally broke down and looked for a solution...and found it in Knowledge Base Article 313899

Wednesday, February 25, 2004 3:16:33 PM UTC  #    -
.NET | WorkArounds
 Thursday, February 19, 2004

When trying to connect to eXist with SOAP from .NET, Jes tells me he and Manu use the following successfully:

QueryService service = new QueryService();
sessionId = service.connect(userName, password);

When I try this, I get:

An unhandled exception of type 'System.NET.WebException' occurred in system.web.services.dll
Additional information: The request failed with HTTP status 405: Method not allowed.

The developer documentation for eXist says the connection sequence should look something like:

QueryService service = new QueryServiceLocator();
Query query = service.getQuery();
String session = query.connect("guest", "guest");

This always results in an error that says QueryServiceLocator doesn't even exist in the namespace.

Thursday, February 19, 2004 6:42:33 PM UTC  #    -
.NET | eXist
 Friday, February 13, 2004

I worked a little on a development Rainbow site, rebuilt it, and tried to view it.  I got an error...



Configuration Error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Access is denied: 'Esperantus'.

Source Error:

Line 256:                <add assembly="System.EnterpriseServices, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
Line 257:                <add assembly="System.Web.Mobile, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
Line 258:                <add assembly="*"/>
Line 259:            </assemblies>
Line 260:

Source File: c:\winnt\microsoft.net\framework\v1.1.4322\Config\machine.config    Line: 258

Assembly Load Trace: The following information can be helpful to determine why the assembly 'Esperantus' could not be loaded.


It took some time to find a link on MSDN that looked similar and recommended to turn off the Indexing Service. 

That worked, but why it was necessary now and not the 1,000 other times I've worked on this app., I don't know. 

Friday, February 13, 2004 6:30:21 PM UTC  #    -
.NET | Rainbow Portal
 Tuesday, February 10, 2004

Jeremy Esland has convinced me that XML is the answer to many of the data problems I am encountering in a variety of projects.  The more I learn about XML, the more I'm sure it's the answer. 

In a related side-note, Jeremy also introduced me to the eXist project.  eXist is a powerful XML storage and retrieval solution that can be run and accessed in a variety of ways. 

Now if I could just get my .NET code to retrieve some documents from eXist...

Tuesday, February 10, 2004 2:24:25 PM UTC  #    -
.NET | XML | eXist

When the IBuySpy portal was released along with ASP.NET 1.0, I pretty much used it to teach myself programming with .NET.  In January 2002, Cory Isakson convinced me that I should abandon the enhancements I'd made to it and join the Rainbow Portal project, even though this meant learning C# along the way. 

More than a year later, I can't believe how Rainbow is growing.  As I type this, I'm listening to the second hour of a broadcasted meeting between Cory and a handful of Boise, Idaho area developers using (or considering, I think) Rainbow for various reasons. 

If you're new to .NET (or software development in general), Rainbow is an excellent place to start.  The learning curve is steep (meaning “challenging, but short“), but the rewards are many. 

It's exciting to be (even a small) part of a project that really has HUGE potential.  Join Rainbow, and you are welcome to be a part of that, too!

Tuesday, February 10, 2004 3:13:37 AM UTC  #    -
.NET | Rainbow Portal
 Friday, February 06, 2004

At my day job, I've been working to update an old quickbasic-centered data storage system to something a little more 21st century.  Along the way, of course, I've had to learn a great deal about QuickBasic and how it stores/retrieves values in text files. 

Our data solution uses fixed-length text records for storage.  One 'quirk' about that is that it also uses QuickBasic's CVI() and MKS() functions to store 16-bit Integers in a 2-character string (so any integer will still fit into our happy little fixed-length string). 

The problem is that Microsoft's .NET doesn't have any functions that resemble CVI(), MKS(), or a number of others that were found in QB (like MKD, CVD, MKI, MKL, CVL).  There are plenty of examples out there for VB6, but not .NET!

Anyway, I've searched pretty hard for a .NET version of CVI(), and finally found one that would work:

Here's the link to the original article, and I'll attach the code for download in case that article goes away some time in the future:

I hope this helps someone else with the same problem.

CV and MK Functions.txt (4.85 KB)
Friday, February 06, 2004 7:27:54 PM UTC  #    -
.NET | QuickBasic
Archive
<March 2010>
SunMonTueWedThuFriSat
28123456
78910111213
14151617181920
21222324252627
28293031123
45678910
Quick Quips
    About the author/Disclaimer

    Disclaimer
    The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

    © Copyright 2010
    John Bowen
    Sign In
    Statistics
    Total Posts: 152
    This Year: 0
    This Month: 0
    This Week: 0
    Comments: 164
    Themes
    Pick a theme:
    All Content © 2010, John Bowen
    Theme modified from the 'Business' theme created by Christoph De Baene (delarou)