Tuesday, June 28, 2011

Being A Developer of Windows Mobile 7


I have a sad news :(  I have never built a Windows Mobile 7 applications.
As Guy Blend and WPF, which bubbled over in Silverlight, it may shock you, but time and effort (not enough of the former and too much of it) kept me do it Hello everyone. Of course, it does not allow Verizon Stinkin WP7 has not yet, but we hope that this issue will arrange soon.

Since I promised to write an annex to the mix in the action focuses on the mixture WP7, I think it's time we jumped on the bandwagon and made some WP7 development.

Where I am from

Since I have Visual Studio and Expression Blend installed everything I need to start developing was to download and install the developer tools Windows Phone. This includes the emulator and necessary WP7 types of projects. If you do not Blend or Visual Studio on your machine, free tools are a part of this installation.

Register App Hub

Since I intend to create and publish real applications I went ahead and created an account AppHub. There are some things you should know before you start. First, it costs $ 99 in advance, so be prepared to pay when creating your account. Second, you need a Live ID. Third, you can not create an account without a website URL. While this may seem trivial, it threw me because I did not create this site, I intend to use my phone still Apps. I went ahead and use this site with the hope that I can change it later.

The next thing I did not expect the requirement of a tag as a player. I'm not a gamer, I do not own an Xbox, and I'm not sure what player is a tag, so I obviously did not deliver. I was stuck on the screen gamer tag you want for a while until I found one I wanted, which was not taken (theblendguy).

The last thing that threw me for a circuit that was to fill in forms, all copies is strongly oriented to XBox Live. Once past the home screen, everything I've read the account was in XBox Hub of the application: there was no mention of Windows Mobile 7. I canceled to make sure I had made the right decision, but decided to go to my guns, especially when I saw the price was right. In fact, when all was said and done, I had the appropriate account.

I received an email confirmation, and graduated from the account. If I understand correctly, the next step is to contact me and GeoTrust to verify I am who I say I am. I like the fact that Microsoft is putting so much effort to examine the accounts and applications: in the long term should mean a stable quality of the applications, which is the beginning, if you want to succeed.

And here is the next step...

The next step is the development of applications. I have a couple in mind already. I'm going to write my experiences as I go forward, so keep watching this space.

The next day I created my account, I received an email from GeoTrust take me to another site where I had to verify my identity. From the start, be prepared for some questions seem intrusive. I had to give them my social security number and possibly my license and some less info such as date of birth and address. Also, if you have been at your current address for less than two years, you must provide the previous address.

This information is the first step. When you place this time, another page comes with a set of questions specific financial, which, theoretically, you should be able to respond. I received questions about my mortgage and car payment, including a couple of trick questions. The answers are multiple choice, so you do not give them special, and it does not matter, because it seems they know it all already anyway.

Of course this is all done in HTTPS, so I'm not concerned about the safety of me when I use a credit card online. I was quite surprised that although the BI is in place to develop a trick question that I mentioned. (And no, I'm not going to be more specific). Overall, the process was tedious, and I passed the test at this stage I'm just waiting for my developer ID AppHub. I will keep you all posted.

And wait for the message in your inbox.

Now that you're an official you can start to develop, and applications.

To Recompile All The Stored Procedures For Database


Recompiling an object is an advantage when the "indexes or other changes that affect statistics are made the database, compiled stored procedures and triggers may lose efficiency. Sp_recompile is a system stored procedure in SQL to rebuild an object, the next time it runs. Recompiling you can re-optimize queries.

Here is the query to recompile all the SPS in the database.

Declare @ name nvarchar (125), @ cmd nvarchar (300)

SPList declare the cursor / Cursor * It must be observed to go through all the SPS DB * /

Select the name of sys.objects

where type = 'P'

SPList open

FETCH NEXT from SPList / * get the record of the cursor * /

in the name @

While @ @ FETCH_STATUS = 0

start

Select @ cmd = 'EXEC sp_recompile [' + @ name + ']'

Exec @ cmd / * recompile the SP * /

FETCH NEXT SPList / * Get the name of SP after the cursor * /

@ In the name

Head

SPList close

Deallocate SPList

Remove The NOT NULL Column Constraint ALTER TABLE


Many times it may be necessary to remove the limitation Not Null applied to a column in a table. It is generally necessary to overcome the unexpected integrity constraints (which rarely happens, if well designed) against a table. We can remove the constaint Not Null using the ALTER TABLE .... ALTER COLUMN ... option.

A sample query is

Alter table dbo.Test

alter column test nvarchar (10) null;

You can also reuse the next.

Alter table dbo.Test

alter column test nvarchar (10) NOT NULL;

Find The Model For SQL Server Using PATINDEX () And CHARINDEX ()


Although these features are not commonly used, is very powerful in the search for a reason and return the location of the text / string / model. By understanding the functionality of the string functions, we will be able to understand the difference too.

PATINDEX ()

The search function of a pattern in a string / expression and returns the starting position of the first occurrence of the pattern. It works similarly to the operator, as in any application.

The general syntax is

PATINDEX ('% pattern%', expression)

You may have already noticed the '%' symbols used in the model. These are important, as I mentioned before, using the same syntax used for research by the LIKE operator.

Choose PATINDEX ('% System%', description) index location, description

From dbo.TestTable

CHARINDEX ()

CHARINDEX () function is similar to PATINDEX (). However, CHARINDEX search for the string expression specified in the start position (Start loction default is 1). If you have already noted above, we can begin to determine the position of PATINDEX ()

The general syntax is

CHARINDEX (expression1, expression2 [, start_location])

An example of the same data set used earlier would look like

Select CHARINDEX ("System", description) index position, description

from dbo.TestTable

We can also start position indlude. Below is a sample search function in the string from the position of three

Select charindex ("System", description, 3) indexlocation Description

from dbo.TestTable

Finally, the main difference between the PATINDEX () and CHARINDEX () is the ability to CHARINDEX To find a specific location.

Reindex The Database With A Large Gap With "DBCC DBREINDEX"


DBCC commands is one of the most commonly used are DBAs worldwide. Today I'm going to present a simple way to index the specific table or all indexes using DBCC.

The command used for this is

DBCC DBREINDEX

General Sytax

DBCC DBREINDEX

(

table_name

[, Index_name [, fillfactor]]

)

The best feature of this command is that we need not abandon such unique or primary key restrictions applied to the index to rebuild the index. This means that the index can be rebuilt without knowing the structure of a table or limitations.

It accepts three parameters. The table name, index name and the fill factor.

This is an example below

The command below will not be indexed and table "IDX_EMPL" "TBL_DIM_EMPL" with a fill factor of 80

DBCC DBREINDEX ("TBL_DIM_EMPL", "IDX_EMPL", 80)

The following command reindex all indexes on the table "TBL_DIM_EMPL"

DBCC DBREINDEX ("TBL_DIM_EMPL", "", 80)

What NULLIF () Do? How It Differs From ISNULL ()?


NULLIF () returns zero if the two specified expressions are equal in function.

Syntax

NULLIF (expression1, expression2)

If expression1 = expression2, the function returns NULL.

ISNULL () function replaces an expression with no specified value.

The syntax used is

ISNULL (expression1, expression2)

If expr1 is NULL, then the function returns expression2 output.

ISNULL functionality can be written using if ... WHEN the

CASE WHEN expression1 THEN END ELSE NULL Expression2 expression1

An example of these two functions are shown below

Select ISNULL (NULL, 'hello') as IsNullOutPut1

, IsNull (1001, 1) as IsNullOutPut2

, NULLIF (100, 100) that NullIfOutPut1

, NULLIF (1, 100) that NullIfOutPut2

Changing The SQL Database In Single User Mode And Back To The Multi-User Mode


It is often necessary to modify the database in single user mode, especially if you are the DBA. A simple example would be to change the sorting options, or settings TE. A single user only allows a user (typically the DBA) to access the database. Therefore, it is easy to make changes without worrying about the blind alleys, and any claim, DB, and also without affecting users.

It is very easy to change the database in single user mode, in fact, it's just a script. Use the following script to change the mode.

ALTER DATABASE < > SET SINGLE_USER no_wait

NO_WAIT clause to set the single-user mode, when you run the query. Replacing this is to use the system stored sp_dboption

EXEC sp_dboption < > 'SINGLE USER', False

However, you must set the database in multiuser mode for other users to use. Without it, it will not be available to others.

Here is a script to set the basis for multi-mode.

ALTER DATABASE < > GAME MULTI_USER no_wait

Or alternative

EXEC sp_dboption < 'SINGLE USER'>, False

I advise you to maintain caution while changing database in single user mode, because it would link users already connected to the database.