Category Archives: Microsoft

.NET ASP.Net 2.0 Microsoft

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”

.NET ASP.Net 2.0 Chrome

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/

Microsoft

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 »

ASP.Net Tips & tricks

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

Microsoft SQL Server Tips & tricks Transact-SQL

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
Microsoft SQL Server Transact-SQL

Insert Multiple Rows in SQL Server

In SQL Server 2005, in order to insert 3 rows to a table, you had to run 3 INSERT statements:

insert into Customers (Name, City, Phone) values (‘Customer #1’, ‘Jerusalem’, ‘2343245’)

insert into Customers (Name, City, Phone) values (‘Customer #2’, ‘Tel Aviv’, ‘0987345’)

insert into Customers (Name, City, Phone) values (‘Customer #3’, ‘Haifa’, ‘275466’)

In SQL Server 2008, you can insert multiple rows in a single insert statement that takes a number of value arrays:

insert into Customers (Name, City, Phone)

values

(‘Customer #1’, ‘Jerusalem’, ‘2343245’),

(‘Customer #2’, ‘Tel Aviv’, ‘0987345’),

(‘Customer #3’, ‘Haifa’, ‘275466’)

Source link

IIS Outlook

OWA saves .docx and .xlsx file as .zip

The problem:

When any Office 2007 attachment (.docx, .xlsx, etc) is opened from OWA, the user is asked to save the document before they open it. When they do this, the default extension is .zip. If the user changes it to the correct extension before opening, the file opens correctly.

This happens because the Office 2007 MIME file types are not configured on the web server and the users browser does not know how to open the files. If IE is configured to open files based on the file header, it identifies the file as a zip, which is technically correct.

The administrator can fix it site wide by adding the Office 2007 file types to the MIME settings on the server.

On the user side, IE has an option to open files based on content, not extension. The user should add the OWA URL to the Trusted (or Local Intranet) list before making this change.

read more »

.NET IIS Microsoft Networking

IIS does not allow downloading files from .mdb format.

add the following to the web.config as follows:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <security>
      <requestFiltering>
        <fileExtensions allowUnlisted="true" >
          <remove fileExtension=".mdb" />
          <add fileExtension=".mdb" allowed="true"/>
        </fileExtensions>
      </requestFiltering>
    </security>
  </system.webServer>
</configuration>

MIME Type must be registered on IIS

Microsoft Silverlight

Silverlight & SQL server connection

You can’t. Instead you should create a WCF service one server that Silverlight can talk to.

Tutorial that does that: http://silverlight.net/learn/tutorials/sqldatagrid.aspx

Your Silverlight app has two projects. One Aspx project for server side, one silverlight on client side.

Your database resides on server side.

You can access it from server side aspx project.

Client side doesn’t know about database.

You can use WCF for connection.

Direct connection is not possible to the database.

IIS Microsoft

Changing the Framework on IIS7

dotnet

Simple, but a little hidden:

  1. Open IIS
  2. Click on “Application Pools” :
  3. In the side panel (right) click on “Website” you want to change the framework:
  4. Sidebar, locate the “Edit Application Pool” and then click Basic Settings
  5. Clicking on “Basic Settings …” will appear the following selection screen FrameWork:
  6. Now, select the framework of your choice by clicking on the list. NET Framework Version:
  7. Once selected click “OK”