Somehow, I ended up with two connection strings in my ASP.NET project.
I don't know where the second one came from (I suppose it could've been user error), but VSWD called it connectionString1 and without my permission or instruction, modified a whole load of other files in my project to suit. So I just took the sledgehammer approach and removed the second connection string and did a project-wide find and replace on all occurrences of connectionString1.
I thought I was ok until I got to the point where I needed to make some changes to the DAL of the application, and the following error appeared:
The error message isn't exactly self-explanatory and VSWD wasn't exactly helpful.
So I started panicking, sweat coming from my brow at the prospect of having to spend hours at figuring out the source of this problem, feeling stupid because I felt that I had caused this problem by messing about with settings I didn't understand.
I could open the DAL .xsd file in Source mode, but could not open it in Design mode. Hmm... seems to be some issue with all of the stuff VSWD does in the background to render the visual portrayal of your DAL...
Anyway, lo and behold the answer came nice and easily. In my DAL's .xsd file, I had two references to exactly the same connection string. So when trying to load it up it got confused, spat the dummy and didn't bother telling me what the problem was.
So if you see this problem in your project, check to make sure that
1) You don't have multiple connection strings in your project where you don't explicitly need them.
2) You don't have duplicate references to your connection strings in your DAL's .xsd file.
I think that error can be caused by other things, but check those two things first and hopefully it'll help.
Thursday, 3 September 2009
Visual Web Developer 2008: Failed to load dataset because of the following error: Unable to find connection
Posted by Phil Reid 0 comments
Labels: asp.net, tech problems, vb.net, visual studio web developer 2008 express
Monday, 31 August 2009
ASP.NET: Server Application Unavailable
If you get this error when you try to access your ASP.NET application: ... it could be caused by a huge number of things.
It happened to me, and to get more information I went to the Event Viewer where some errors had showed up. Specifically these two errors: 
and:
This page is quite useful in explaining the potential problems and gives a few ideas for resolution. I went through a lot of them but the answer ended up being very simple.
The ASPNET user account somehow became locked out, so all I had to do was go into Control Panel > Administrative Tools > Computer Management > Local Users and Groups and look at the properties for the ASPNET account.
The account was marked as locked out, so I uncleared the checkbox and restarted IIS with an iisreset at the command line. Then I tried to access my application and it worked!
It was so straightforward, but I still have no idea why the account became locked out in the first place!
Posted by Phil Reid 0 comments
Thursday, 27 August 2009
Apple Tablet: Will Steve's New Toy do the Job?
Many people apparently believe that Apple are about to announce a new gadget, the Apple Tablet.
Since it's such a work of art, I always thought it would be cool to take an iPod Touch and enlarge it by several times. It looks a bit like the Tablet (if it actually appears) will look just like that.I really hope that they do release such a gadget, because aside from an iPhone I've never owned a Mac. It looks like it could be the perfect first buy; possibly portable, durable and running Mac OS X, with a user experience that beats the hell out of Windows (not that difficult).
Of course, it's going to be expensive and demand will undoubtedly reach fever pitch,
so I better start saving!
Posted by Phil Reid 0 comments
Thursday, 13 August 2009
Posting Code in Blog Posts
It's a nightmare trying to post any code in Blog posts. The tags confuse Blogger (fair enough) so if it happens, it won't let you post the code.
I tried to install SyntaxHiglighter from Google, but it requires you to host its code on a webserver somewhere and I couldn't get it to work.
Stanley Shilov came up with a nice alternative online tool which you can paste your code into, and it will parse it and replace any characters which will confuse your blogging engine with HTML tags which it'll love. You can access the tool here, and it needs zero set up and zero hassle.
The drawback is that it doesn't offer any syntax highlighting, but it's still useful and I'll certainly be using it in future!
Posted by Phil Reid 0 comments
Labels: Posting Code in Blog Posts
ASP.NET: Adding a simple Ajax Web Service with AutoCompleteExtender in Visual Studio 2008 Express
I'd been really struggling to get any kind of Ajax functionality in my ASP.NET project. The first problem was that I couldn't be sure if I had enabled the Ajax extensions in my project, so to verify it I decided to try to create a new 'ASP.NET Ajax Enabled Web Site' template in Visual Studio.
But I couldn't see that option, and wondered if I had the wrong version of the .NET framework installed. No - that was fine, I had 3.5. So it must be something else. Until I discovered that Visual Studio 2008 Express automatically adds the Ajax extensions to any new ASP.NET project you create in it. So that's good.
But when I went to add an AutoCompleteExtender to my ASPX page, I couldn't see the control in my Toolbox. This was odd. But EVENTUALLY I discovered that I was missing the AjaxControlToolkit.dll from my project's Bin folder. This comes as part of the Ajax Control Toolkit, which you can download from CodePlex:
So I downloaded the Binary package (to avoid all the extra crap that comes with it) and dropped the AjaxControlToolkit.dll into the Bin folder of my Project. Then I right-clicked on the Toolbox in VS2008 and selected Choose Items. Selecting the DLL file now meant that after a couple of seconds of chewing it over, the Ajax controls I needed appeared in the Toolbox.
Now I had to see if I could get an extremely simple Ajax control set up on my page, just to see if it was working. So I dragged a new texbox onto my page, gave it a name and then dragged a ScriptManager control onto the page. Next, I had to add an AutoCompleteExtender control which would target the text box I chose, and Ajax enable it.
<cc1:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" MinimumPrefixLength="1" ServiceMethod="HelloWorld" ServicePath="WebService.asmx" TargetControlID="TextBoxAjax"> </cc1:AutoCompleteExtender>
So now I have an Ajax enabled control on my page, and finally I needed to set up a web service to feed it something. So I created a new web service called WebService.asmx and added the following code to it:
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.ComponentModel
' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
<System.Web.Script.Services.ScriptService()> _
<System.Web.Services.WebService(Namespace:="http://tempuri.org/")> _
<System.Web.Services.WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<ToolboxItem(False)> _
Public Class WebService
Inherits System.Web.Services.WebService
<WebMethod()> _
Public Function HelloWorld(ByVal testStr As String) As String()
Dim returnString(2) As String
returnString(0) = "one"
returnString(1) = "two"
returnString(2) = "three"
Return returnString
End Function
End Class
It creates a WebService.asmx.vb file too, which actually contains the code above. So all the HelloWorld function does is return a string array to the Ajax textbox.
I built and started the app, and voila - when I type something into the box, the values 'One','Two','Three' appear below. It's not smart at all at this point, since the web service just returns those values no matter what is typed into the text box. But it's square one, and it's a good place to start. 
Next step, add some proper code to the Web Service which returns the correct autocomplete values based on what's typed.
Posted by Phil Reid 0 comments
Labels: ajax, asp.net, tech problems, visual studio web developer 2008 express
Tuesday, 4 August 2009
Solution: IIS - You Are Not Authorised To View This Page
If you're setting up a new site on IIS, and occasionally (usually after you lock your workstation and log back in, or if you leave it for a long period of time) when you attempt to view a site on your localhost or on another remote machine using IIS - you might see the page displayed which says:
"You are not authorized to view this page (Error 401.1)"
If you're allowing anonymous access to your site using the IIS account, a temporary workaround is to run an iisreset at the command line. But a longer term (and less irritating) solution is to go into the Directory Security properties of your Virtual Directory in IIS configuration and uncheck the box which says "Allow IIS to control password".
Then do an iisreset and the error shouldn't appear again, unless there are deeper problems with your security set up.
Posted by Phil Reid 0 comments
Labels: iis, tech problems
Thursday, 30 July 2009
Solution: Blank Report Manager (SQL Server 2005 Reporting Services)
If, after installing Reporting Services you see a blank screen when trying to open Report Manager, you can try the below methods to get you moving.
· Enable Integrated Windows Authentication in the Reports (and ReportServer) virtual directories in IIS, and disable Anonymous Access.
· Restart IIS (iisreset on command line)
· Try to open Report Manager. If your account is recognised as an Administrator, you should see more content in Report Manager.
· Add the local anonymous IIS account (IUSR_MACHINENAME) to the Administrators group for the local machine (this is just temporary, read on).
· Restart IIS (iisreset on command line)
· Try to open Report Manager - you should now see full content.
· Go to the Properties tab, and click New Role Assignment. Grant the IUSR_MACHINENAME account the appropriate privileges to access the Report Manager (be careful not to allow too much access since this means your users could change/delete reports).
· Remove the IIS account from the Administrators group for the local machine.
· Enable Anonymous Access for the Reporting Services virtual directories in IIS, and disable Integrated Windows Authentication.
· Restart IIS
· You should now be able to see the appropriate content within Report Manager.
Hope this helps! It worked for me, and I had been going mad with frustration
Posted by Phil Reid 0 comments
Wednesday, 29 July 2009
SQL Server 2005 Installation: Issues and Resolution (Errors 29559 and 29515)
I was attempting to install SQL Server 2005 Developer Edition with the following components, and experienced some issues:
· Database Services
· Analysis Services
· Reporting Services
· Integration Services
I thought it might be useful to share my findings in case a Google search brings up these errors and the resolutions I found, since I eventually managed to get everything installed.
Some people might have opposing views on the steps I took, but it works now and that's the main thing.
- SQL Server 2005 Error 29559
Full Error Text (From Windows Event Viewer): "Product: Microsoft SQL Server 2005 -- Error 29559. SQL Server Setup failed to modify security permissions on service MSSQLServerADHelper for user V024755. To proceed, verify that the account and domain running SQL Server Setup exist, that the account running SQL Server Setup has administrator privileges, and that exists on the destination drive."
Background: When attempting to install SQL Server, the following error appeared near the end of the installation when it was attempting to configure Database Services. Was connected to the installation machine over Remote Desktop (mstsc). Had initiall selected to install all of the desired SQL Server 2005 components, with all except database services installing succcessfully in this installation.
Workaround: Logged onto machine directly rather than over mstsc. Checked that domain account was a member of the Adminstrators group. Removed all traces of SQL Server 2000 files from C:\Program Files\Microsoft SQL Server\80. Modified file permissions on all files and folders under that location to allow full control to the appropriate domain account.
Result: The above error did not reappear, the installation proceeded past this point though another error was encountered. - SQL Server 2005 Error 29515
Full Error Text (From Windows Event Viewer): "Product: Microsoft SQL Server 2005 -- Error 29515. SQL Server Setup could not connect to the database service for server configuration. The error was: [Microsoft][SQL Native Client]Encryption not supported on the client. Refer to server error logs and setup logs for more information. For details on how to view setup logs, see "How to View Setup Log Files" in SQL Server Books Online."
Background: After setup had proceeded past the point of error 29559 above, the installer was attempting to start the database engine service when the above error occurred. The suggestion was that the problem was caused by the fact that some SQL Server 2005 components (Integration Services, Visual Studio 2005 IDE etc) had installed successfully in the very first installation, so there was some kind of conflict caused.
Workaround: Removed all traces of all SQL Server (2000 and 2005) installations to begin from a 'clean slate'.
NOTE: Everything except Microsoft SQL Server Setup Support Files - you need this to complete 2005 uninstallation. If this does not appear in Add/Remove Programs, you can reinstall it by running SqlSupport.msi, located in the installation folders.
- Removed everything related to SQL Server which was visible in Add/Remove Programs dialog.
- Followed uninstall steps for SQL Server 2000 from Microsoft website.
- Followed uninstall steps for SQL Server 2005 from Microsoft website.
- Deleted C:\Program Files\Microsoft SQL Server and all its contents (You may experience file lock issues when attempting to delete, in this case you can use Process Explorer to identify which process has a lock on the file and kill it, at your own risk!).- Restarted machine
- Restarted installation, to install Database Services only. This was done with the goal of minimising risk by introducing installation of other components.
Result: Installation was successful of Database Services.
- Started installation of remaining components (Analysis Services, Reporting Services, Integration Services), without Database Services.
Result: Installation of remaining components was successful.
Conclusion
· Remove all instances of SQL Server 2000 before you do any installation of SQL Server 2005 whatsoever, do not attempt to upgrade if at all possible.
· Ensure you have administrator privileges on the machine where SQL Server is being installed.
· Install Database Services first, before any other components.
· Once installation of Database Services is successful, then install remaining components.
Posted by Phil Reid 0 comments
Tuesday, 7 July 2009
Windows Remote Desktop (mstsc) can't connect: quits unexpectedly
I'm in London and I've been trying to establish a remote connection to another machine which I use for development.
I needed to access it so that I could work remotely while away, but when connecting using Remote Desktop (mstsc on the command line) I could see the log in dialog and enter my details, but as soon as I pressed 'OK' it just quit. No error messages, nothing!
I tried using the IP address, and the fully qualified hostname but no cigar. What drove me even more mad was that I previously tested that I could connect to the machine when the laptop and desktop were physically right next to each other.
But as soon as I moved away from the same location, I found I was unable to connect.
I thought it was something to do with trying to connect to it from another IP subnet, but I managed to connect remotely to a third machine which was on the same subnet, and from there I still could not connect to the target machine.
I thought it was odd that I could connect to one machine, but not the other. So I did a search of the Microsoft support website, and it turns out that the problem is a dodgy NVIDIA display driver! Apparently it doesn't like people connecting remotely, so it just decides to kill the connection with no error and no warning.
See this support article: http://support.microsoft.com/kb/886212/en-us which suggests rolling back your NVIDIA driver.
But in the short term, if you have an NVIDIA graphics card and if this problem has been driving you mad and you are unable to roll the driver back, hopefully this will help. I think the problem is due to the multiple monitor functionality that comes with the NVIDIA driver software. So if you have that enabled, then this might help.
My resolution was:
- Get the machine restarted
- It *should* let you log in since there is no session to restore
- Disable the nView functionality
For me, that meant Bob was my Uncle. But it remains to be seen if I can disconnect and then reconnect to my session on the remote PC.
Posted by Phil Reid 0 comments
Labels: remote desktop, tech problems, windows
Friday, 26 June 2009
SQL Server Job Error: Failed to decrypt protected XML node "DTS:Password" with error 0x8009000B
If you deploy some DTSX packages to SQL Server, and create an Agent job to run them, you might see this error:
Failed to decrypt protected XML node "DTS:Password" with error 0x8009000B
The workaround is probably simple. When deploying to your SQL Server and you're on the Specify Target SQL Server page of the wizard, select the 'Rely on server storage for encryption':
That should probably do it. If not, check out this thread on MSDN.
Posted by Phil Reid 0 comments
Labels: sql server, sql server agent, sql server error