Tuesday, 31 March 2015
Monday, 30 March 2015
Posted by Unknown on 03:15
with No comments so far
Introduction:
We can add and remove Indexes on table
in sql server. Indexes can be added and drop by using query in SQL server.
in this I will explain how to remove index from table in sql server 2008 or drop index from table in sql server. To remove index from table we use drop index statement in sql server.
in this I will explain how to remove index from table in sql server 2008 or drop index from table in sql server. To remove index from table we use drop index statement in sql server.
To create index on column in sql server that syntax will be like as shown
below
Syntax to Create Index
CREATE INDEX indexname ON Tablename(columnname)
Example:
CREATE INDEX IC_Userid ON UserDetails(UserId)
Remove index on table
Syntax to Drop Index on Column
DROP INDEX tablename.indexname
Example:
DROP INDEX UserDetails.IC_Userid
Posted by Unknown on 02:13
with No comments so far
Introduction:
When
create table and set Primary key, an index will be created automatically. But
we can also set index manually.
I this article I will explain how to create index on column in or create index on multiple columns in sql server or create index on table in sql server 2008 with example.
I this article I will explain how to create index on column in or create index on multiple columns in sql server or create index on table in sql server 2008 with example.
Create Index
on Single Column:
Syntax to Create Index
CREATE INDEX indexname ON Tablename(columnname)
Example:
CREATE INDEX IC_Empid ON EmpDetails(EmpId)
Create nonclustered index on table
Syntax to Cre ate
NonClustered Index on Column
CREATE NONCLUSTERED INDEX indexname ON Tablename(columnname)
Example:
CREATE NONCLUSTERED INDEX NC_Empid ON EmpDetails(EmpId)
create index on multiple columns at a time
Syntax to Create Index on Multiple Columns
Syntax to Create Index on Multiple Columns
CREATE INDEX IC_Empid ON Table_Name(Col1,Cpl2)
Example:
CREATE INDEX IC_Empid ON EmpDetails(EmpId,EmpName)
Saturday, 28 March 2015
Friday, 27 March 2015
Thursday, 26 March 2015
Posted by Unknown on 23:58
with No comments so far
We can bind or load
Listbox control from database to show dynamic values. In this article I am
going to explain how to bind or fill ListBox control from back end database
e.g. Sql Server and How to get selected Item and selected Value from ListBox
control.
Posted by Unknown on 02:52
with No comments so far
Introduction: In this article I will explain the reason and solution to fix to the error “Validation of viewstate MAC failed.
Why this occurs:
Solution:
There are three solutions to
fix this issue:
1.
First Method :
is
to set the EnableViewStateMac to false in the web.config:
<system.web>
<pages enableViewStateMac="false">
.
.
.
</pages>
</system.web>
2.
Second Method:
is to set the EnableViewStateMac to false at page level as:
<%@ Page EnableViewStateMac="false" Language="C#" AutoEventWireup="true"CodeFile="Default.aspx.cs" Inherits="_Default" %>
But in case of large no of web pages it’s not possible to
make changes on every page.
3. Third Method: Best and Recommended solution is to specify our own value for encryption and decryption in the web.config file i.e.
Machine Key. We can generate the machine key
via the Unique Machine KeyGenerator.
Below is the sample keys.
<system.web>
<machineKeyvalidationKey='D3A686722DDE36968147312E2D0EF0F61AC13C1725723317ABE201CE98EF3876E962748E28307308BBA1B4C9E670D52822C8B19E35657725C798FA51E6641F0C'decryptionKey='85C571FEEBFAF94517FAAC3136A29CAAA800033B909EDB52'validation='SHA1'/>
</system.web>
Generate your own keys and
replace the validationKey and decryptionKey with your own unique generated keys.
All methods are useful in solving this problem. But it is recommended to use machine keyin web config file. This is the best solution an less time consuming. Other reason is secutity, because when we set the EnableViewStateMac value to false we expose our application to security threats.
Subscribe to:
Posts (Atom)