Tuesday, August 12, 2008

Set up SQL Server Mode

In this tutorial we are going to focus on setting up the SQL Server method for maintaining session state. Here are the steps for setting this method up on your SQL server:
• Connect to your SQL server using Query Analyzer
• Open the SQL script InstallSqlState.sql script that is normally located in C:\Windows\Microsoft.Net\Framework\[YourVersion]. Replace C: with the drive letter you have yours installed on. This script will create the ASPState database, tables, and stored procedures needed for this method of maintaining session state.
• If using a trusted connection for connecting to your SQL server you must change ownership of the ASPNet database to the 'sa' account. To do this, in Query Analyzer run this
SQL
use ASPNet
exec sp_changedbowner 'sa', 'true'

The sp_changedbowner stored procedure is a system stored procedure that is used to, you guessed it, change the owner of a database.
• If you decide to use SQL Authentication instead of Windows Authentication you need to create a user account for the process. This account must have, at the very minimum, execute rights for all the stored procedures in the ASPNet database.
Now that we have your SQL Server configured for this mode of state management, we now need to configure your Web application to look at your newly created ASPState database. Fortunately doing this is far fewer steps than getting the database ready. These steps are:
• Set the mode of the sessionState element in your web.config to SQLServer.
• Set the sqlConnectionString attribute of the same element to the connection string for your SQL server. The web.config should now look like:
CODE
mode="SQLServer"
sqlConnectionString="data source=YourServer;user id=YourUsername;password=YourPassword"
cookieless="false" timeout="20" />
Now you have your SQL Server ready for this, and your Web application ready, so you would think you're done now right? Not necessarily; Lets say you're running SQL Server 2000 with Service pack 3, if this is the case the first time you run your Web application against your ASPState database you're going to get errors such as:
CODE
SELECT permission denied on object 'ASPStateTempApplications', database 'tempdb', owner 'dbo'.
Why is this you might ask, well Im glad you asked because I have the answer. Service Pack 3 for SQL Server 2000 adds a new secutiry feature, which as you can imagine from the above error message, is disabled by default. This new security feature is Cross DB Ownership Chaining. How nice of Microsoft to inform you of this before you went through all this isn't it.

don't be discouraged, fortunately this can be enabled by running the sp_configure and sp_dboption system stored procedures. First you run the sp_configure stored procedure, like so
SQL
use master
go
EXEC sp_configure 'Cross DB Ownership Chaining', '0';
RECONFIGURE
GO
Then reboot your SQL Server. Once your server is rebooted you will then need to run the sp_dboption stored procedure, like this:
SQL
use master
go
EXEC sp_dboption 'ASPState', 'db chaining', 'true'
go
Once you have completed this final step your SQL Server is now ready to handle session state management. There you have it, setting up session management using SQL Server 2000. In the next tutorial we will look at setting up a state server for session management, until then I hope you found this tutorial informative and useful. Thanks for reading and happy coding!

SQL SERVER 2000 - EXEC master..xp_cmdshell permissions

[xp_cmdshell]
Extended stored procedures are essentially compiled Dynamic Link Libraries (DLLs) that use a SQL Server specific calling convention to run exported functions. They allow SQL Server applications to have access to the full power of C/C++, and are an extremely useful feature. A number of extended stored procedures are built in to SQL Server, and perform various functions such as sending email and interacting with the registry.
xp_cmdshell is a built-in extended stored procedure that allows the execution of arbitrary command lines. For example:
exec master..xp_cmdshell 'dir'

TO execute any EXE from your stored procedure then you will need to use
XP_cmdshell command. It will successfully execute the exe.

Syntax of cmd shell:-

DECLARE @CMDPATH VARCHAR (500)
SET CMDPATH= 'exepath.exe ' +convert(varchar, @param1) + ' ' + convert(varchar,@param2)
EXEC master ..XP_CMDSHELL @CMD

Just try it....

Monday, August 4, 2008

select one radio button which are in datalist in asp.net

ASPX Page Code--------->

javascript tag start from here---
function CheckOnes(chkControl)
{
var oItem = chkControl.children;
var theBox= (chkControl.type=="radio") ? chkControl : chkControl.children.item[0];

xState=theBox.unchecked;
elm=theBox.form.elements;

for(i=0;i

Data list code------------->
within datalist use server side checkbox
DataList ID="lstTemplates" runat="server" OnItemDataBound="lstTemplates_ItemDataBound"/
ItemTemplate/ asp:RadioButton ID="rdbTemplate" runat="server" /ItemTemplate
/DataList

Server side code for DataList-------------->

protected void lstTemplates_ItemDataBound(object sender, DataListItemEventArgs e)
{
RadioButton rdb;
rdb = (RadioButton)e.Item.FindControl(" rdbTemplate?);>if (rdb != null)
{
rdb.Attributes.Add("onclick", "CheckOnes(this);");
}
}

Sunday, August 3, 2008

Check and Uncheck All Checkboxes in a DataList using ASP.NET and C#

Here's the client-side javascript function in the aspx page


function CheckAll(checkAllBox, fieldName)
{
var frm = document.Form1;
var actVar = checkAllBox.checked;
for(i = 0; i < frm.length; i++)
{
e = frm.elements[i];
if (e.type == 'checkbox' && e.name.indexOf(fieldName) != -1)
e.checked = actVar ;
}
}


function UnCheckAll(fieldName)
{
var frm = document.frmAdsKeyword;
for(i = 0; i < frm.length; i++)
{
e = frm.elements[i];
if (e.type == 'checkbox' && e.id.indexOf(fieldName) != -1)
e.checked = false ;
}
return false;
}

Thursday, July 24, 2008

No Security tab exist in properties of folder in windows XP.

security tab missing - no security tab - enable security tab - no security tab xp - windows xp no security tab - missing security tab - no security tab in properties - sharing and security tab missing - xp no security tab - no security tab in XP - folder security tab missing - all - no security tab windows xp - sharing and security missing - "no security tab" - no security tab in windows xp - windows no security tab - how to enable security tab - security tab not showing - sharing tab missing - security tab is missing - no sharing and security tab - permissions tab missing - windows xp security tab missing - no security tab in folder properties - xp folder Security tab missing - explorer security tab missing - security tab missing xp - security tab missing in folder properties - how to enaBLE SECURITY TAB IN XP - no security tab in explorer - enable security tab in xp - no security tab on file properties - no sharing tab - windows xp security tab not showing - security tab missing windows xp - enable security tab xP - Security tab missing from folder - missing security tab in folder properties - no security tab under properties - missing folder security tab xp pro - hide security tab - no security tab on folder properties - security tab missing in file properties - security tab not found - windows xp missing security tab - no security tab - windows sharing tab missing - no security tab on xp - security tab not showing in folder properties - windows xp pro no security tab - hide sharing tab - missing security tab on folders - security tab not showing xp - xp security tab missing - Security tab missing from Properties - file properties no security tab - +"windows xp" +"file properties" +ntfs +"security tab" - security tab not showing on folder - sharing tab is hidden - folder security option not showing - "missing security tab" explorer ntfs - no security tab windows - "windows xp" "no security tab" - folder properties security tab missing - security tab missing from folder properties - no security tab on file - no security tab in windows explorer - folder missing security tab - sharing tab is missing - missing security tab folder properties - unhide security tab in XP - use simple file sharing missing - enable security tab in folder properties - security tab not shown -

Missing or No Security Tab Found in Windows XP Professional.

Security tab for the properties of files or folders in Windows XP Professional is the important functionality that enable administrators and users to define security permissions and rights for particular user or group to the computer resources. By default, Windows XP Professional follows recommended setting to enable the use of simple file sharing that hide the Security tab, leaving you with only General, Sharing, Web Sharing & Customize tabs as in the Simple File Sharing UI.

So to see and unhide the Security tab, just use the following steps:

Launch Windows Explorer or My Computer.
Click on the Tools at the menu bar, then click on Folder Options.
Click on View tab.
In the Advanced Settings section at the bottom of the list, uncheck and unselect (clear the tick) on the “Use simple file sharing (Recommended)” check box.
Click OK.
Security tab is available only to Administrator or users with administrative rights. So make sure you login as one. And security can only be set in an NTFS partition. If you’re still having problem to reveal or display the Security tab on files or folder properties, check out the following registry hack and set the value to 0 or simply delete the key:

Hive: HKEY_CURRENT_USER
Key: Software\Microsoft\windows\CurrentVersion\Policies\Explorer
Name: Nosecuritytab
Type: REG_DWORD
Value: 1

If you’re using a Windows XP Professional system that is installed in a Workgroup, the Security tab is also hidden by default because in Windows XP Home Edition and Windows XP Professional, guests are forced to log on to a workgroup. Follow the instruction and information on Microsoft Knowledge Base where you need to set the value for ForceGuest registry key.

How to enable the security tab in folder properties for Windows XP.

follow the given bellow steps to find security tab in folder properties.
1.go to run promt
2.type gpedit.msc
3.group policy window will open
4.in that window u can see computer configuration
5.under that option u can see windows settings.
6.click that option and click security settings.
7.now u can see one folder in the name of
local policies .click that option
8.now u can see security option . click that.
9.now u can see more options in one window.
10. now press "N" and search where is
NETWORK ACCESS: SHARING AND SECURITY FOR LOCAL ACCOUNTS option.
11.click that option. and new window will pop up
12.in that window u can see one drop down box.
now u should select classic: local users
authendicate as themselves.

now close all the windows .open one folder select properties . now u can see security tab...

Split the String values with a special character in MS Flow to convert this into Array

 Many times we have a requirement to prepare the Mailing address for some of the documents, suppose there are Address Line1, Address Line2, ...