or
Friday, December 30, 2011
html encoding table
or
Thursday, December 29, 2011
create time duration using c#
Wednesday, December 28, 2011
set global variable in javascript
Thursday, December 22, 2011
Open new window using a href
Thursday, December 15, 2011
connect to web service with SLL settings
unable to download wsdl file
Tried many times but this error still occurs, then I search in google, and last thing I found is this site: http://debugguru.blogspot.com/2008/06/unable-to-download-wsdl-file-while.htmland indeed it solved the problem, wkwkwk.. Just close the solutions, and reopen, I tried to add web reference again, it works, lol.
But apparently I don't use the web reference. I try to connect to wsdl using Service Reference.
I try to connect, but this error occurs:
Could not establish trust relationship for the SSL/TLS secure channel with authority 'xx.xx.x.xx'.
I search over the net then I found this code:using System.Net.Security;
using System.Security.Cryptography.
public class TestUtils
{
public static void OverrideCertificateValidation(
{
ServicePointManager.
}
private static bool RemoteCertValidate(object sender, X509Certificate cert, X509Chain chain, System.Net.Security.SslPolicyE
{
return true;
}
}
Hope it will be useful for you :)
-julie-
working with xml
There are 3 links to get the values from. From the first xml file, I manage to find a way to get the value based on the node name.
Get nodes (and values) after selected node
Dictionaryprivate
{
XmlTextReader reader = new XmlTextReader(URLString);
reader.WhitespaceHandling = WhitespaceHandling.None;
XmlDocument doc = new XmlDocument();
doc.Load(reader);
if ((doc != null))
{
try
{
int i = 0;
XmlNodeList elemList = doc.GetElementsByTagName(tagName);
foreach (XmlNode elem in elemList)
{
for (int j = 0; j < elem.ChildNodes.Count; j++)
{
callChildNode(elem.ChildNodes[j]);
}
i++;
}
}
catch (Exception ex)
{
// exception
throw ex;
}
}
}
private void callChildNode(XmlNode node)
{
if (node.Name != "#text")
if (node.ChildNodes.Count == 1 )
dict.Add(node.Name, node.InnerText);
for (int j = 0; j < node.ChildNodes.Count; j++)
{
callChildNode(node.ChildNodes[j]);
}
}
From the line above, all the nodes with value after the tag that we defined will be listed inside the dictionary. That is for the case if you have a different xml tag that you wish to get the node value from (even if the node inside is the same with the node from the other tag).
------
Get node value based on another node's value
After the first XML, I thought everything is solved, but then when I saw the second XML, it was totally different from the first xml. Dang!! so I have to find a way to get value of a node based on another node's value.
I searched in the internet and got a sample of code from the link below:
http://stackoverflow.com/questions/6203666/xpath-select-a-node-based-on-another-node
Below are the code
var doc = new XmlDocument();
doc.LoadXml(xmlString);
XmlElement element = (XmlElement)doc.SelectSingleNode("Items/Item[Code='MyCode']/Value");
Console.WriteLine(element.InnerText);
Hope this two code will be useful..
Friday, October 7, 2011
Default value and constrain of a table

Tuesday, October 4, 2011
share folder files to be access from asp.net application
and the document can be viewed from client.
Last time I deployed the application to production, they (my customer) said that the file server is on different server, so it will be a share folder, the path is gonna be like this: \\server_name\sharefolder$
Then after I re-setting the application's config into new document folder path, and it result on the my application have access denied. And the condition is, the share folder cannot be granted to everyone, so I set only for Domain\Administrator.
After testing several times, giving the security of the folder to ASPNET user, NETWORK SERVICE user, still doesn't working.
In my desperation, I set Sharing permission to Everyone, and yes it works, but that 's not gonna solve the security issue. Then I tried to set Everyone to Security (not Sharing) and remove the one on Sharing tab, still not work. Then I think, there should be somebody that has to be added on Sharing so it will work, not on Security.
Try to add ASPNET user, but still not working. Then my last chance, NETWORK SERVICE, and tadaaaa.. it works like a charm.
So what I want to say here is, I think we cannot assume that Security is more powerful that Sharing tab. The two of it has it's own behaviour, in this case, the NETWORK SERVICE user has to be added in Sharing tab, not Security. But added in both tab will also works :D
thats all, hope it helps.


update:
Oh yeah, i forgot, there is something you have to set in IIS, gave to the one which have access to that folder. to get to this window, right click on your website, then choose properties.
Saturday, October 1, 2011
error page not found asp.net
The problem is... maybe you haven't allowed the .net framework. You have to set the .Net Framework in Web Service Extensions to Allowed instead of Prohibited. That's all.. :)
PS: the Web Service Extensions folder is located in IIS 6, on the bottom of the treeview on left frame.
error when backing up database
error Cannot open backup device 'F:\foldername'. Operating system error 5(Access is denied.)
the solutions is:
.
.
.
assign a more powerful user to SQL Server Service
source:
http://social.msdn.microsoft.com/forums/en-US/sqldatabaseengine/thread/021c7aa5-4a8a-4bbb-8ff0-fe6b03920aae/
Saturday, September 3, 2011
Kill Open Transaction in SQL
DBCC opentran
after that you will get this result if there is no open transaction:
No active open transactions. DBCC execution completed. If DBCC printed error messages, contact your system administrator.
or else if you have open/uncommited transaction that maybe cause by error in design, you will get this :
Transaction information for database 'db_name'.
Oldest active transaction: SPID (server process ID): 54 UID (user ID) : -1 Name : user_transaction LSN : (1702:160598:3) Start time : Sep 4 2011 12:27:32:713AM SID : 0x0105000000000005150000008cdebb00f310b4f0b1a5950ae8030000 DBCC execution completed. If DBCC printed error messages, contact your system administrator.
If you want to kill the process, remember the SPID, then open the Activity Monitor, then killed it by right clicking on it, then choose Kill Process.
in SQL Server 2000, you can find Activity Monitor in Enterprise Manager, then expand the tree like below picture, the activity monitor will be shown in right frame.
After you right clicked and killed the process, you have to refresh it manually by right clicking on Current Activity - in SQL Server 2005, Activity monitor can be find in SQL Server Management Studio, inside Management tree node, double clicked it, than a window of processes activity will be show, as picture below:

in SQL Server 2008, Activity monitor were located on the toolbar of SQL Server Management Studio, as shown in picture below:


After you killed the process, you don't have to refresh it, just wait until it disappear from the list in few seconds.
^^
