Wednesday, December 23, 2009

Tester vs. Developer

Developer vs. TesterThis is just an intermezzo... lol...
Share:

Monday, December 7, 2009

Error while trying to debug VB.NET desktop application

Error:Error while trying to run project: Could not load file or assembly "AssemblyName" or one of its dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)This error appears as a dialog box while trying to debug an application.Solution:1. Check if the assembly name used for the project contains ' (apostrophe)....
Share:

Tuesday, November 10, 2009

Ado command object returns method 'Execute' of object '_Connection' failed

Error: method 'Execute' of object '_Connection' failedSolution: Check the query used while executing the recordset, it may contain keyword used in the database. In my case, my query is:select languageid, language from masterlanguage order by languageidThe error occurs because...
Share:

Friday, November 6, 2009

Disabling web.config inheritance for child application

Error:Configuration ErrorDescription: 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: Could not load file or assembly 'Control' or one of its dependencies. The system cannot find the...
Share:

Pinky award :D

Another award from a sweet friend, Ria Adria...
Share:

Wednesday, November 4, 2009

Error uploading file in ASP.NET

Error:XML Parsing Error: no element foundLocation: http://10.21.9.12/Web/UploadFile.aspxLine Number 1, Column 1:^This error occurs because the size of the file uploaded is too big and not handled in the web.config.Solution: add this tag to the web.config in the <system.web></system.web> section:<system.web> <httpRuntime maxRequestLength="2048000"></system.web>There's...
Share:

Sunday, November 1, 2009

Another blog award ^^

Have just got a lovely blog award, my second one, from a friend, Mona ^^But there is a rule to accept this award.. hehehe... Post it on your blog together with the name of the person who has granted the award, and his or her blog link. Pass the award to 15 other blogs that you’ve...
Share:

Wednesday, October 14, 2009

Creating Sub Report using TTX in VB

Before creating sub report using TTX in VB, you should have already known how to create report using TTX. Otherwise, you may want to find out how to create report using TTX in my previous post.Before going to the sub report, it's a good idea to share the code query in Visual...
Share:

Friday, October 2, 2009

Playing with Query - Grouping

Query Language : SQL Simply saying, here are the tables: table users (userid, name) table book (bookid, bookname, author) table review (reviewId, UserId, BookId, Comment, ReviewDate) Question: Find users who have reviewed 2 different books on the same day! Query for creating...
Share:

Wednesday, September 30, 2009

Fail creating virtual directory

Error: Creation of the virtual directory http://localhost/web failed with error: Could not find the server 'http://localhost' on the local machine. Creating a virtual directory is only supported on the local IIS server.This error appear as a dialog box when trying to load a...
Share:

Friday, August 21, 2009

Login fail for Sql User

Error: server: msg 18452, level 16, state 1 [microsoft][odbc sql server driver][sql server]login failed for user 'user_name'. Reason: not associated with a trusted sql server connectionSolution: Open Sql Server Enterprise Manager, go to SQL Server Group -> Choose the server...
Share:

Thursday, August 13, 2009

Awards from friend

I've just noticed the way to put awards from friends... hahaha.. lolAwards from Ria Adria...
Share:

Tuesday, July 28, 2009

Unable to start debugging on the web server

Error : Error while trying to run project: Unable to start debugging on the web server. Server side-error occurred on sending debug HTTP request.Make sure the server is operating correctly. Verify there are no syntax errors in web.config by doing a Debug.Start without Debugging. You may also want to refer to refer to the ASP.NET and ATL Server debugging...
Share:

Saturday, July 25, 2009

Making table of contents in ms. word 2007

There are times when we need to make table of contents after making an article. It would be quite troublesome to make it manually if the article is long enough. Fortunately, if you're writing it in ms. office, there has been a functionality provided for it.Here is a video about how to make table of contents using ms. word 2007. It should be more or...
Share:

Friday, July 24, 2009

Retrieving Tables and Columns in a Database

This is how to retrieve tables & columns in the table from a database:Dim rs As ADODB.RecordsetSet rs = New ADODB.RecordsetSet rs = con.OpenSchema(adSchemaColumns)While Not rs.EOF Text1.Text = Text1.Text & rs!Table_Name & " - " & rs!COLUMN_NAME & vbCrLf rs.MoveNextW...
Share:

Retrieving Tables in a Database

This is how to retrieve all tables in a database:Object needed:A Textbox named Text1Dim rs As ADODB.RecordsetSet rs = New ADODB.RecordsetSet rs = con.OpenSchema(adSchemaTables)While Not rs.EOF If rs!Table_Type = "TABLE" Then Text1.Text = Text1.Text & rs!TABLE_NAME & vbCrLf rs.MoveNextW...
Share:

How to get column names of a table

This is how to retrieve column / field names of a table from VB using adodb connection:con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\database.mdb;Persist Security Info=False"Set rs = New ADODB.Recordsetsql = "select * from table_name"Set rs = con.Execute(sql)Dim i As IntegerFor i = 0 To rs.Fields.Count - 1 MsgBox...
Share:

Thursday, July 23, 2009

CustomError mode

Error :Server Error in '/' Application.Runtime ErrorDescription: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.Details: To...
Share:

Error detected by database DLL

Error : Error detected by database DLLThis error occurs when trying to open report produced using Crystal Report in application, one of which is application developed using VB.Solution :1. If you are using ODBC, make sure the ODBC has been created.Here are the steps to create...
Share:

Adding web reference in Visual Studio 2008 or later

Some people get confused adding web reference in Visual Studio 2008 or later, since it's not by default in the Solution explorer. Only Service reference is shown.Web reference is actually still available on Visual Studio 2008 or later.Just right-click on the project where the web reference is to be added, choose Add Service Reference, then click Advanced...
Share:

Wednesday, July 15, 2009

Operation is not allowed when object is closed

Error: Operation is not allowed when object is closed.Solution:1. Check if a recordset or connection is opened before recordset operation is performed.2. If stored procedure is used while retrieving the data to recordset, REMEMBER to use "SET NOCOUNT ON" at the beginning of the stored procedure. This is a problem which usually occurs when multiple...
Share:

Friday, July 3, 2009

Posting to blog from Ms. Office 2007

You can directly post to your blog without having to go your blog first.Simply open your Microsoft Word 2007, then choose New -> New Blog Po...
Share:

Tuesday, June 30, 2009

Validation of viewstate MAC failed

Error : Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machinekey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.Solution : Add this part to the web.config System.Web section:<pages enableEventValidation="false" viewStateEncryptionMode...
Share:

Thursday, June 25, 2009

Fail loading Web Application Project

Error : I do not quite remember the exact error, encounter it long time ago, and just now, a friend asked about it again. The error contain the words ..... System.Runtime.InteropServices.COMException...It is characterized by web application project not being loaded while opening a solution, while any other projects open well.Solution : Check whether...
Share:

Debug not working on VS 2003.Net

Problem : Debug is not working on Visual Studio.NET 2003. There are some problems with Visual Studio 2003. Yet, still using it in some projects. One common problem is that the debug is not attached to the process while run in debugging mode. Hence, the breakpoints set will not be hit. This is sometimes annoying, when errors occur, and we're looking...
Share:

Thursday, June 18, 2009

Can not add service reference / web reference

Error : The components required to enumerate web references are not installed on this computer. Please re-install Visual studio.This error pops up as a dialog box while trying to add service reference / web reference.Solution : Press window + Run, then type "devenv /resetskippkgs" (without quotes), then press Enter.This command clears all options ...
Share:

Error with web service

Error variations:- No connection could be made because the target machine actively refused it.- The request failed with HTTP status 404: Not FoundSolution : Check whether the URL for the web service is set properly.This problem appears to be a debugging problem when web service is used for desktop application. Yet, it appears to be a deploying problem...
Share:

Wednesday, June 17, 2009

Creating Simplified Duwamish from a scratch

This is a step by step on how to create an asp.net C# web application using simplified Duwamish framework. I call it simplified Duwamish framework, because it is not the real Duwamish. It is my own version. I like it better, after eliminating some parts of the Duwamish framework...
Share:

Tuesday, June 16, 2009

Logon failed on Crystal Report

Error : Logon failed. Details: ADO Error Code: 0x Source: Microsoft OLE DB Provider for SQL Server Description: Login failed for user 'UserXXX'. SQL State: 42000 Native Error: Error in File E:\TEMPSY~1\Tmp\temp_xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}.rpt: Unable to connect: incorrect log on parameters.Solution :...
Share:

Saturday, June 13, 2009

Appending ArrayList to another ArrayList

A friend of mine asked about how to append an ArrayList to another ArrayList in C#. I found out that it's an easy task as long as the type of the ArrayList is the same. Just have to typecast it to ICollection.e.g.ArrayList a = new ArrayList();a.Add("Array 1");a.Add("Array 2");ArrayList b = new ArrayList();b.Add("Array 3");b.Add("Array 4");a.AddRan...
Share:

Tuesday, June 9, 2009

Open and close CD-ROM tray in VB

Create a module, and put this code in it:Declare Sub mciSendStringA Lib "winmm.dll" (ByVal lpstrCommand As String, ByVal lpstrReturnString As Any, ByVal uReturnLength As Long, ByVal hwndCallback As Long)To Open CD-ROM tray, use this method:Sub OpenCDTray() mciSendStringA "Set CDAudio Door Open", 0&, 0, 0End SubTo Close CD-ROM tray, use this...
Share:

Delete data by date

Sometimes, new Visual Basic developers may meet such problems as retrieving data by date. Just need to use # to make it righte.g.db.Execute "DELETE FROM table_name WHERE FieldDate < #" & Format(Date, "yyyy/mm/dd") & ...
Share:

Tuesday, June 2, 2009

Data on report won't change

Problem : If you're using crystal report to design a report and the data displayed on the report won't change.Solution : Go check the report. Open it, then make sure that on menu File -> Save Data With Report -> is NOT checked.This is actually a minor problem, but sometimes, people forget or don't notice ...
Share:

Invalid Handle in Crystal Report

Error : Invalid HandleAn error dialog box which says "Invalid Handle" shows while saving crystal report document.Solution : The solution may vary in this case. Sometimes, there isn't even any mistake with the report.1. Search for crw32.exe on the computer, in accordance with the version of Crystal Report being used, right-click the file -> properties...
Share:

Monday, May 25, 2009

Kido Virus (continued)

I guess the virus is not clean yet -.-""""" Still facing the same problems when the computer starts -.-""""" Finally, do a system restore and have everything back. phew...
Share:

Wednesday, May 20, 2009

Kido Virus

This actually has nothing to do with programming, but can't help posting it here. I guess my computer was infected by a virus, tried every way to fix it, none succeeds. I was using Kaspersky antivirus, then one morning when I turn on the computer, the protection is not running, and the update tab disappears.A virus named Kido has been attacking my...
Share:

Monday, May 18, 2009

Redirecting and hiding URL

Problem : I wanted to make a link that will redirect the users to download a pdf file. Yet, I have to hide the URL, and can't let the users know the URL to the file.Solution : I use repeater to hide the URL by using CommandArgument and CommandName attributes.I make a repeater which looks more or less like this on the aspx:<asp:repeater id="rpt"...
Share:

Error using Server.Transfer

Error : Invalid path for child request 'http://localhost/Content/foldername/pdf_filename.pdf'. A virtual path is expected.I was using Server.Transfer on links to redirect the web to another page, and this error occured.Solution : DO NOT user Server.Transfer when redirecting to another web server. Use Response.Redirect inste...
Share:

Cannot create/shadow copy when file already exists

Error : Cannot create/shadow copy '..........' when that file already exists.Solution : Rebuild solution / Clean solution, then rebuild.Don't know why this actually happens. But it happens often, after building solution without debugging for tim...
Share:

Tuesday, May 12, 2009

Using System.Web.Routing

Use URL Routing on application recently, and find some difficulties when developing.When opening page which applies URL routing, it shows error that the page doesn't exist.Should check this point:Add a wildcard mapping .* to aspnet_isapi.dll and make sure that Check that file exists is unchecked.Go to IIS, right click the virtual directory of the application,...
Share:

Friday, May 8, 2009

Import data from excel to table in SQL

A friend asked about how to import data from Excel to table in SQL, then I searched for it. Found this code. Having tried it, I think it's a nice idea to share it.INSERT INTO Table_NameSELECT column1, column2FROM OPENROWSET ('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=C:\ExcelTable.xls', 'SELECT * FROM [Sheet1$...
Share:

Thursday, May 7, 2009

Read & Write .ini files

Reading from and writing to .ini files is very useful and is a widely used method to set or get some uncertain keys, such as database location, period, or any other things that are common, but are subject to change.It is not necessarily .ini files. The extension may vary, depends on the developer will, but .ini is the most commonly used extension.It's...
Share:

Wednesday, May 6, 2009

Browser asks for username & password while debugging

Problem : The browser keeps asking for username and password while debugging.Solution :1. Check on IIS if you're using IIS, by pressing window + R, then type "inetmgr" without quotes. Go to the website on the default web site. Then right click, properties, on directory security, check Anonymous Access, and make sure you also check Integrated Windows...
Share:

ADO: Recordcount return -1

Error : Recordcount May Return -1 while using ADO connectionThe problem is ADO defaults to a Server side cursor. You can only use the RecordCount property with a Client side Cursor.Do something like...rsMyRecordset.CursorLocation = adUseClientIf I may guess, the reason the RecordCount doesn't work in your code is that the default cursortype, adOpenForwardOnly,...
Share:

Friday, May 1, 2009

Generate random characters

There is a way to generate random characters in a simple way, just use :select NEWID()This function is quite useful in some occasions, though may not be it's main usage.e.g. If you're going to generate a random quote from a table named MsQuote : SELECT TOP 1 QuoteId, QuoteText FROM MsQuote ORDER BY NEWI...
Share:

Stored procedure's dependencies

Find the dependencies of a stored procedure / Find tables used in a stored procedure:use sp_depends sp_n...
Share:

Sys on SQL

Not sharing query, but some tips that might be useful when looking for a needle in a haystack.Am using Microsoft SQL Server 2000, but won't differ too much on later versions, I guess.Find tables with the specified name-----------------------------------select name from sysobjects where name like '%table_name%' and type = 'u'Find stored procedures with...
Share:

Friday, April 24, 2009

Can't debug on IE

Error : I forget about the error messages. If I'm not mistaken, the error message was just as common. As far as I remember, it sounds like this :Unable to Start Debugging on the Web Server... user is not a member of "debugger users"Solution : Run Internet Explorer (it should be more or less the same in other browsers), choose menu Tools -> Internet...
Share:

ASP.NET State Service

Error :Unable to make the session state request to the session state server. Please ensure that the ASP.NET State service is started and that the client and server ports are the same. If the server is on a remote machine, please ensure that it accepts remote requests by checking thevalue of HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\aspnet_state\Parameters\AllowRemoteConnection....
Share:

Crystal Report error while deploying

Error : Could not load file or assembly 'CrystalDecisions.ReportAppServer.CommLayer, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of itsdependencies. The system cannot find the file specified.Solution : Install crystal report runtime available in Visual Studio CD, on the serv...
Share:

Error on connection string

Error : An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)Solution : Check if the connection...
Share:

Error on event validation

Error :Invalid postback or callback argument. Event validation is enabled using in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected,...
Share:

Also cannot debug application

Error : Error while trying to run project: unable to start debugging on the web server. the project is not configured to be debugged.This is the most widely retrieved error while developing web applications... Hahaha... And the solutions may vary greatly. This solution works in my case.Solution : re-register aspnet to IIS. Go to start menu -> Programs...
Share:

Cannot debug application

Error : Cannot start service from the command line or a debugger. A Windows Service must first be installed (using installutil.exe) and then started with the ServerExplorer, Windows Services Administrative tool or the NET START command.Solution : Check the start-up project. Make sure the start-up project is the web application, not a class library...
Share:

Error while building on release mode

Error : "LC.exe" exited with code -1073741701I was building a pre-compiled web in release mode (using WebDeployment program). As known, compiling in release mode always retrieves undiscovered errors -.-"""Solution : Exclude licenses.licx file from project, then rebuild again.There was a time when I faced the same problem, after my computer was attacked...
Share:

Parser Error

Error :Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.Parser Error Message: Could not load type 'Web.MasterPages.GeneralTemplate'.Source Error:Line 1: <%@ Master Language="C#" AutoEventWireup="true"...
Share:

Ambiguous match found

Error :Server Error in '/Web' Application.Parser ErrorDescription: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.Parser Error Message: Ambiguous match found.Source Error:Line 1: <%@ Control Language="c#" AutoEventWireup="false"Codebehind="GeneralTemplate.ascx.cs"...
Share:

Error when using ajax component

Error : The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.Web.HttpException:...
Share:

Error connecting to undo manager of source file

Error : Error connecting to undo manager of source file.This error occur when debugging a web application on asp.net.Solution :1. Delete the aspx.designer.cs file2. Right-click the aspx, select convert to web application.There are 3 layers (that's how I call it) on asp.net web application, i.e. Design layer(.aspx), Coding layer(.cs), and the other...
Share:

Username & Password requested when downloading

Problem : When downloading a file, username and password is requested.Solution : If I'm not mistaken, I used impersonation on the web, so have to grant permission on the IIS. Go to control panel -> Administrative Tools -> Internet Information Services. Or simply press window + Run, then type inetmgr.Right-click Default Web Site, properties, go...
Share:

Can't access local web aplication from another computer

Error : No error, it's just that local web application can not be accessed from another computer.Solution : go to control panel -> windows firewall -> add port :Name : HTTPPort Number : 80Type : TCPe.g.Accessing web from local : http://localhost/webName/Default.aspxWhen accessing from another computer, just use the ip address of the computer...
Share:

Error displaying report

Error : C:\DOCUME~1\STEVEN~1\ASPNET\LOCALS~1\Temp\temp_c31eb8a4-2e63-4b42-b43d-c91550cca5b4 {25A8AD89-FCF3-4B82-A544-375DE1838F98}.rpt: Unable to connect: incorrect log on parametersThis problem is quite typical, and happen under some typical conditions. I was using crystal report to view a report on a web page, and the connection used for the report...
Share:

Assemblies / DLL not included

Error : One or more Assemblies / DLL have not been included...I forgot the exact error message, but it should include those words. This error is caused by the unavailability of one or more DLLs when deploying.Solution : Some DLLs, that are imported components, are usually not copied to deployment folder. To make them copied when creating deployment...
Share:

File has not been pre-compiled

Error : The file '/Web/Default.aspx' has not been pre-compiled, and cannot be requested. I used WebDeployment program to compile the web on release mode. Solution : Re-copy the compiled files. This problem usually occurs when deploying pre-compiled web. Maybe missed some files while copying the files. Try re-copy the compiled fil...
Share:

Wednesday, April 22, 2009

Error when creating deployment project

Error : The target directory could not be deleted. Please delete it manually, or choose a different target.File : ASPNETCOMPILERSolution : Delete publish folder (the folder where the published web is located), then try compiling in release mode aga...
Share:

Problem with server / Web Service

Error : No connection could be made because the target machine actively refused itSolution : If you use web service or get data from a server, check whether the web service is working properly, or the connection to the server is availab...
Share:

Friday, April 17, 2009

Check whether a file exists or not

This is actually a simple code, but someones may not know it when first using VB, so I post it here.Here's the code to find a file named file.txt:If Dir(App.Path & "\file.txt") <> "" Then MsgBox "Found: file.txt"End...
Share:

How to detect running program

Make a module and use the functionality of API to make it work.Code in the module:Option ExplicitPrivate Declare Function GetWindowText Lib "user32.dll" Alias "GetWindowTextA" _(ByVal hwnd As Long, ByVal lpString As String, ByVal nMaxCount As Long) As LongPrivate Declare Function EnumWindows Lib "user32.dll" _(ByVal lpEnumFunc As Long, ByVal lParam...
Share:

How to clear all textboxes in a form

Sometimes, when we use a lot of textboxes in a form, and want to clean all the textboxes the form, it's not efficient to clean it one by one by using Text1.Text = "", Text2.Text = "", etc.There is a short way to do it:Dim a As ControlFor Each a In Form1 If TypeOf a Is TextBox Then a.Text = "" End IfN...
Share:

Wednesday, April 15, 2009

Get file name from a path in VB

One of my friend once asked how to get file name from a path. There're actually a lot of ways to do it. I'll try a simple one, using Split and UBound function.e.g. the path is C:\Test\DeeperPath\EvenDeeperPath\Test.txtand we're going to get the file name, i.e. Text.txtThe name of the controls:textbox : Text1, containing the pathSome things we have...
Share:

Connecting Crystal Report and VB using TTX

I'd like to share how to make a report using Crystal Report, and connect it from VB here, since there has been several friends asking about this.There are actually several ways to connect VB and Crystal Report, ones of which that I've ever used are using TTX and ODBC.I'd like...
Share:

You may be intersted in

Related Posts

Updating Table Containing Xml Column via LinkedServer

If you are trying to update a table containing XML column via Linked Server in SQL Server, and you are not able to, you are not alone. There...

About Me

My photo
Is an ordinary man, with a little knowledge to share and high dreams to achieve. I'd be glad if I can help others, 'coz the only thing for the triumph of evil is for a good man to do nothing.

About Blog

You can find a lot of debugging and deploying problems while developing applications in .NET and Visual Basic here. There are also some querying tips in SQL and typical source codes which might be useful shared here.

Popular Posts

Blogroll

Followers

Leave a Message