Author Archives: admin

.NET Framework 4 Chart Controls

You can now download Visual Studio 2010 projects that contain all the samples targeting .NET Framework 4.

The samples environment for Microsoft Chart Controls for .NET Framework contains over 200 samples for both ASP.NET and Windows Forms. The samples cover every major feature in Chart Controls for .NET Framework. They enable you to see the Chart controls in action as well as use the code as templates for your own web and windows applications.

ChartSamples_thumb_1.jpg

The samples environments each contains a Getting Started section to help you start using the Chart controls quickly. The samples demonstrates how to use the following features in Microsoft Chart Controls for .NET Framework:

  • All supported chart types.
  • Data series, chart areas, axes, legends, labels, titles, and more.
  • Data Binding
  • Data manipulation, such as copying, splitting, merging, alignment, grouping, sorting, searching, filtering, and more.
  • Statistical formulas and financial formulas.
  • Advanced chart appearance, such as 3D, anti-aliasing, lighting, perspective, and more.
  • Chart rendering.
  • Events and Customizations.
  • Interactivity and AJAX.

http://archive.msdn.microsoft.com/mschart

Remove Black Arrows from horizontal ASP.Net menu

<asp:Menu ID=”Menu1″ runat=”server” DataSourceID=”SiteMapDataSource1″
Orientation=”Horizontal” >

Set:

staticEnableDefaultPopOutImage= False

use your own image:

StaticPopOutImageUrl=”~/images/down_arrow.gif”

Asp.net menu control not working on Google Chrome

To solve this you will need to tell .net the capabilities of the browser. For .net 2.0 & above you need to create a new browers file with the capabilities and upload it to your server.

  1. In VS2008 Solution Explorer right click your application and add the “ASP.Net Folder” App_Browsers if you don’t already have it.
  2. Add a New “Browser File” item to this special folder and call it safari.browser (if fixing the problem for Chrome)
  3. Delete all the default stuff VS put in this file and replace it with the following:
    <browsers>
    <browser refID=”safari1plus”>
    <controlAdapters>
    <adapter controlType=”System.Web.UI.WebControls.Menu” adapterType=”” />
    </controlAdapters>
    </browser>
    </browsers>
  4. Save your file & test locally to see if all is well.
  5. Now for the annoying bit. Upload the new app_browser folder & file to your production server, if you have used the “copy web site” menu option to upload or sharepoint or frontpage, these will create a new folder under app_browsers called vti_cnf
  6. Manually delete the vti_cnf folder under app_browser on your production server. If you don’t you’ll get “Parse error: Data at the root level is invalid. Line 1, position 1.” in your new safari.browser file.
  7. Remember to manually delete this vti_cnf folder everytime you make a change to the app_browser folder or contained files.

So there you go, how to solve the control rendering problems with Google’s Chrome.

For original post you can visit

http://fabenterprises.wordpress.com/2009/03/21/aspnet-menu-not-rendering-correctly-in-googles-chrome/

Merge Field Formatting in Microsoft Word

Seems like ever since version 2002/XP, formatting just isn’t right in mail merges anymore. A few of the problems that are caused:

  • Leading zeroes are dropped from zip codes
  • Currency doesn’t show up with a dollar sign and two decimals
  • Dates come out wrong

read more »

Using Character Encoding in ASP.NET

Open the file named web.config in the ASP.NET project. The value of requestEncoding attribute in globalization element is “utf-8”. It means the requested texts were encoded as UTF-8 character set. Because SCO5.05 does not support UTF-8, therefore the requested texts where changed.

VB:

Public Shared Function unicode_iso8859(ByVal src As String) As String
Dim iso As Encoding = Encoding.GetEncoding(“iso8859-1”)
Dim unicode As Encoding = Encoding.UTF8
Dim unicodeBytes As Byte() = unicode.GetBytes(src)
Return iso.GetString(unicodeBytes)
End Function

Public Shared Function iso8859_unicode(ByVal src As String) As String
Dim iso As Encoding = Encoding.GetEncoding(“iso8859-1”)
Dim unicode As Encoding = Encoding.UTF8
Dim isoBytes As Byte() = iso.GetBytes(src)
Return unicode.GetString(isoBytes)
End Function

label1.Text = iso8859_unicode(MyString)

more details in http://www.codeproject.com/KB/aspnet/Encoding_in_ASPNET.aspx

Error: Unable to load DLL (iclit09b.dll)

Problem:

An unhandled exception of type ‘System.DllNotFoundException’ occurred in ibm.data.informix.dll

Additional information: Unable to load DLL (iclit09b.dll).
The type initializer for \”IBM.Data.Informix.IfxConnection\” threw an exception.

The system Operating is Windows 2003 Server with Share point and
the server informix is INFORMIX-SQL Version 7.30.HC4

Solution:

If you are trying to use IBM.Data.Informix (Client 2.81 TC3, 2.9, 3.5, etc.) from IIS, and you still have this problem, I have a solution. I found that IIS 5.1 has a bug!!. IIS cannot read the entire PATH environment variable if it’s too long (my PATH has 1364 characters). So if your informix dir is near the end of your PATH and your PATH is too long, IIS will never read your informix dir (“C:\Program Files\IBM\Informix\Client-SDK\bin”).

Just put your informix dir at the beginning of your PATH variable, and very important execute an “iisreset” and the issue will gone away. I don’t know if this bug remains in IIS 6.0 or later. But you can try this.

If I’m correct this will help to solve other problems when you’re trying to access unamanaged dlls from IIS:
“Unable to load DLL ‘foo.dll’: The specified module could not be found.”

Source link

Excel: Automated Trim Function For Whole Column

Sub trimcol()
Dim r As Range
Set r = Intersect(Range(“C1”).EntireColumn, ActiveSheet.UsedRange)
r.Value = Evaluate(“IF(ROW(” & r.Address & “),IF(” & r.Address & “<>””””,TRIM(” & r.Address & “),””””))”)
End Sub

vbc : warning BC40010

error message:
I get this message when building my Assembly :

————————————————————————————–

Updating references…
Performing main compilation…
vbc : warning BC40010: Possible problem detected while building assembly ‘asdasd’: Referenced assembly ‘asdasd’ is a localized satellite assembly
Building satellite assemblies…

—- Done —

Rebuild All: 2 succeeded, 0 failed, 0 skipped

————————————————————————————–

The assembly you are building is localized differently than the assembly that are referencing.

This probably means that somewhere in the source code for “asdasd” you have an AssemblyCultureAttribute that is present. Code assemblies should never have this attribute — if you remove it, the problem should go away.

source: http://forums.asp.net/p/338021/355306.aspx#355306

Web 3.0 The Movie

Web 3.0 from Kate Ray on Vimeo.

Web 3.0 é o tema de uma curta-metragem feita por Kate Ray, uma jornalista/psicologa da NYU, onde mostra uma visão sobre a web semântica.

O video conta com entrevistas a Dixon, Tim Berners-Lee, Clay Shirky, entre outros.

SQL to Select a random row from a database table

Select a random row with MySQL:

SELECT column FROM table
ORDER BY RAND()
LIMIT 1

Select a random row with PostgreSQL:

SELECT column FROM table
ORDER BY RANDOM()
LIMIT 1

Select a random row with Microsoft SQL Server:

SELECT TOP 1 column FROM table
ORDER BY NEWID()

Select a random row with IBM DB2

SELECT column, RAND() as IDX 
FROM table 
ORDER BY IDX FETCH FIRST 1 ROWS ONLY

Select a random record with Oracle:

SELECT column FROM
( SELECT column FROM table
ORDER BY dbms_random.value )
WHERE rownum = 1

source link: http://www.petefreitag.com/item/466.cfm