Wednesday, July 7, 2010

function to get Month name in C#

I'm reproducing just part of the code:
 
string sDate = iMonth.ToString() + "/01/" + iYear.ToString();

DateTime dtDate = Convert.ToDateTime(sDate);

lblMonth.Text = dtDate.ToString("MMMM");

It's not difficult, right? But I took some time to find the answer in a forum...

 

 

Monday, June 21, 2010

concatenating strings in Oracle

Different from SQL, there is a function to concatenate strings in Oracle. Here it is:

Concat(str1, str2) - only two arguments!

For example

Table City_Province

CityName Province
Toronto ON
North York ON

Select Concat (CityName, Province) as City from City_Province;

Results:

TorontoON
NorthYorkON

But, if you want some spaces and commas or stuff like that between the fields (of course you want), you can do this:

Select CityName || ',' || Province as City from City_Province

Results:

Toronto,ON
NorthYork,ON

Much better, isn't it?

Sunday, April 18, 2010

JavaScript debugger

To debug a page with javascript, you can use firebug:

https://addons.mozilla.org/pt-BR/firefox/addon/1843

According to my friend MMs, it's really a God's thing!

Monday, April 12, 2010

Nortel VPN message: Unable to reach server

After struggling some time with this problem, I found in a forum the solution!
For those who have Windows Vista, you should stop the ICS (Internet Connection Sharing) Service. And... that's it! So simple!

Wednesday, March 31, 2010

sp_helptext in Oracle

To get a result similar to sp_helptext SQL Server procedure in Oracle, you can use the following query:

 

SET LINESIZE 132
SET LONG 4000
SELECT TEXT 
  FROM ALL_SOURCE
 WHERE NAME = 'YOUR_PROCEDURE_NAME'

 

If you have another solution, please let me know… I didn’t find anything better than this…

PS: You should use the command window to be able to execute this query

Monday, March 22, 2010

XSD generator (converts XML to an XSD file)

For those who needs an XSD file and doesn’t have enough time to learn how to do it, you can use the functions in this website to get your xml converted in xsd:

 

http://www.hitsw.com/xml_utilites/