When you change web hosting enviroment in Visual Studio 2012 from build-in IIS Express to locally installed IIS 8, this error message may occur.
Simple solution: Run Visual Studio "As Administrator", even you are local Administrator.
Software architecture and development in .NET, SharePoint, SQL Server, Windows Server, Best Practices
streda 14. novembra 2012
utorok 13. novembra 2012
SharePoint 2010 error: The user does not exist or is not unique
štvrtok 13. septembra 2012
How to create and enable fulltext for documents on MS SQL Server 2008
This is real working example:
database name = sps
database owner name = sps
table name = DR_BLOBSTORAGE
column name with content = CONTENT
PK = SID
PK index name = DBL_PK
You need to have a table with this three types of columns
CREATE TABLE [dbo].[DR_BLOBSTORAGE](
[SID] [dbo].[SID] NOT NULL,
[CONTENT] [image] NULL,
[DOC_TYPE] [varchar](10) NULL,
CONSTRAINT [DBL_PK] PRIMARY KEY CLUSTERED
(
[SID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
1. Check if fulltext is enabled on the database and enable it.
USE sps
if (select DATABASEPROPERTY(DB_NAME(), N'IsFullTextEnabled')) <> 1
exec sp_fulltext_database N'enable'
2. Create fulltext catalog with name spsdr_catalog, case insensitive.
CREATE FULLTEXT CATALOG [spsdr_catalog] WITH ACCENT_SENSITIVITY = OFF
AUTHORIZATION [sps] .
Later, you can manage it here in MS SQL Management Studio
3. Get all languages possible to index.
SELECT * FROM sys.fulltext_languages
3. Create fulltext index
CREATE FULLTEXT INDEX ON [dbo].[DR_BLOBSTORAGE]
(
CONTENT --Full-text index column name
TYPE COLUMN DOC_TYPE --Name of column that contains file type information
Language 1051 --1051 is LCID for the Slovak language
)
KEY INDEX DBL_PK
ON spsdr_catalog
WITH CHANGE_TRACKING OFF, NO POPULATION;
4. Start population (indexing)
ALTER FULLTEXT INDEX ON [dbo].[DR_BLOBSTORAGE]
START FULL POPULATION;
5. Check population status:
select objectproperty(object_id('[dbo].[DR_BLOBSTORAGE]'), 'tablefulltextpopulatestatus') as TableFullTextPopulateStatus
0 = Idle.
1 = Full population is in progress.
2 = Incremental population is in progress.
3 = Propagation of tracked changes is in progress.
4 = Background update index is in progress, such as automatic change tracking.
5 = Full-text indexing is throttled or paused.
Starting status will be 1, but after a while (depending of the count of documents already in database) it will change to 0.
6. Test fulltext search
select * from dr_blobstorage where contains(CONTENT,'Test')
enjoy
MichalC
database name = sps
database owner name = sps
table name = DR_BLOBSTORAGE
column name with content = CONTENT
PK = SID
PK index name = DBL_PK
You need to have a table with this three types of columns
CREATE TABLE [dbo].[DR_BLOBSTORAGE](
[SID] [dbo].[SID] NOT NULL,
[CONTENT] [image] NULL,
[DOC_TYPE] [varchar](10) NULL,
CONSTRAINT [DBL_PK] PRIMARY KEY CLUSTERED
(
[SID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
1. Check if fulltext is enabled on the database and enable it.
USE sps
if (select DATABASEPROPERTY(DB_NAME(), N'IsFullTextEnabled')) <> 1
exec sp_fulltext_database N'enable'
2. Create fulltext catalog with name spsdr_catalog, case insensitive.
CREATE FULLTEXT CATALOG [spsdr_catalog] WITH ACCENT_SENSITIVITY = OFF
AUTHORIZATION [sps] .
Later, you can manage it here in MS SQL Management Studio
3. Get all languages possible to index.
SELECT * FROM sys.fulltext_languages
3. Create fulltext index
CREATE FULLTEXT INDEX ON [dbo].[DR_BLOBSTORAGE]
(
CONTENT --Full-text index column name
TYPE COLUMN DOC_TYPE --Name of column that contains file type information
Language 1051 --1051 is LCID for the Slovak language
)
KEY INDEX DBL_PK
ON spsdr_catalog
WITH CHANGE_TRACKING OFF, NO POPULATION;
4. Start population (indexing)
ALTER FULLTEXT INDEX ON [dbo].[DR_BLOBSTORAGE]
START FULL POPULATION;
5. Check population status:
select objectproperty(object_id('[dbo].[DR_BLOBSTORAGE]'), 'tablefulltextpopulatestatus') as TableFullTextPopulateStatus
0 = Idle.
1 = Full population is in progress.
2 = Incremental population is in progress.
3 = Propagation of tracked changes is in progress.
4 = Background update index is in progress, such as automatic change tracking.
5 = Full-text indexing is throttled or paused.
Starting status will be 1, but after a while (depending of the count of documents already in database) it will change to 0.
6. Test fulltext search
select * from dr_blobstorage where contains(CONTENT,'Test')
enjoy
MichalC
streda 27. júna 2012
For vs. Foreach performance when iterating a generic list
The simplest way is "Test it"!
Performance test:
10 items:
FOR 00:00:00.0000040
FOREACH 00:00:00.0000018
1000 items:
FOR 00:00:00.0000131
FOREACH 00:00:00.0000098
100 000 items:
FOR 00:00:00.0010038
FOREACH 00:00:00.0007952
10 000 000 items:
FOR 00:00:00.1031941
FOREACH 00:00:00.0819216
Conclusion:
When you don't need to manipulate items in collection, use Foreach, otherwise For.
Performance test:
Code Snippet
- class Program
- {
- static void Main(string[] args)
- {
- List<int> list= new List<int>();
- for(int i =0; i < 10000000 ; i++)
- {
- list.Add(i);
- }
- int sum = 0;
- Stopwatch sw = new Stopwatch();
- sw.Start();
- for (int i = 0; i < list.Count; i++)
- {
- sum += list[i];
- }
- sw.Stop();
- Console.WriteLine(" FOR {0}", sw.Elapsed.ToString());
- sw.Reset();
- sum = 0;
- sw.Start();
- foreach (int item in list)
- {
- sum += item;
- }
- sw.Stop();
- Console.WriteLine(" FOREACH {0}", sw.Elapsed.ToString());
- sw.Reset();
- Console.ReadLine();
- }
- }
10 items:
FOR 00:00:00.0000040
FOREACH 00:00:00.0000018
1000 items:
FOR 00:00:00.0000131
FOREACH 00:00:00.0000098
100 000 items:
FOR 00:00:00.0010038
FOREACH 00:00:00.0007952
10 000 000 items:
FOR 00:00:00.1031941
FOREACH 00:00:00.0819216
Conclusion:
When you don't need to manipulate items in collection, use Foreach, otherwise For.
utorok 26. júna 2012
How to shutdown Windows 8
1.) From "classic" Desktop
There isn’t an intuitive way. Just press Alt + F4 on your keyboard and the Shut Down dialog will appear. Before using this shortcut method, make sure all running applications are closed.
2.) From Metro:
Put your mouse at the bottom-right corner of the screen until the new menu appears.
Or press Win + C (better way)!!
Click Setting
Now click Power button to access Shutdown
There isn’t an intuitive way. Just press Alt + F4 on your keyboard and the Shut Down dialog will appear. Before using this shortcut method, make sure all running applications are closed.
2.) From Metro:
Put your mouse at the bottom-right corner of the screen until the new menu appears.
Or press Win + C (better way)!!
Click Setting
Now click Power button to access Shutdown
Prihlásiť na odber:
Príspevky (Atom)