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:

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