Saturday, February 25, 2012

SQL Server user can access all databases issue

Following are the steps to resolve this issue.


1. Go to user's properties:






2. Go to user mappings:
    2.1. check the default database for login.
    2.2. check db_owner in database role membership. 













3. click default schema button
    3.1. type dbo and click on.



4. click server roles and confirm uncheck of sysadmin permissions.






Monday, September 20, 2010

javascript to change validation group name

change group name :

Enable proxy in web config

<system.net>

    <defaultProxy enabled="true">
        <proxy usesystemdefault="True" proxyaddress="http://192.168.0.254:3128" />    </defaultProxy>

</system.net>

javascript to set cookies

function Set_Cookie( name, value, expires, path, domain, secure )
{
// set time, it's in milliseconds
var today = new Date();
today.setTime( today.getTime() );

/*
if the expires variable is set, make the correct
expires time, the current script below will set
it for x number of days, to make it for hours,
delete * 24, for minutes, delete * 60 * 24
*/
if ( expires )
{
expires = expires * 1000 * 60 * 60 * 24;
}
var expires_date = new Date( today.getTime() + (expires) );

document.cookie = name + "=" +escape( value ) +
( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) +
( ( path ) ? ";path=" + path : "" ) +
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );
}

Create classes from xml file

Go to command prompt and execute the following commands:


xsd file.xdr [/outputdir:directory][/parameters:file.xml]
xsd file.xml [/outputdir:directory] [/parameters:file.xml]
xsd file.xsd {/classes | /dataset} [/element:element]
             [/language:language] [/namespace:namespace]
             [/outputdir:directory] [URI:uri] [/parameters:file.xml]
xsd {file.dll | file.exe} [/outputdir:directory] [/type:typename [...]][/parameters:file.xml]


example:

xsd ".xml" /outputdir:"C:"
xsd ".xsd" /outputdir:"C:" /language:C# /namespane:asd class