User Row_Number function
Ex:
SELECT c.FirstName, c.LastName
,ROW_NUMBER() OVER(ORDER BY SalesYTD DESC) AS 'Row Number'
,s.SalesYTD, a.PostalCode
FROM Sales.SalesPerson s
INNER JOIN Person.Contact c
ON s.SalesPersonID = c.ContactID
INNER JOIN Person.Address a
ON a.AddressID = c.ContactID
WHERE TerritoryID IS NOT NULL
AND SalesYTD <> 0;
Monday, May 28, 2007
Tuesday, May 22, 2007
Could not establish a connection to the database
by default in the machine.config, it contains the following default connectionstring for all the SQL Server providers:
http://aspadvice.com/blogs/plitwin/archive/2005/11/04/13590.aspx
http://aspadvice.com/blogs/plitwin/archive/2005/11/04/13590.aspx
Friday, May 18, 2007
Debug SQL Server 2005
Either way, once the procedure exists, you are ready to start debugging from Visual Studio 2005. When you start up Visual Studio for debugging purposes, you don't have to create a project. Instead, you can create a connection to the AdventureWorks database from Server Explorer, as I have done in the screenshot shown in Figure 1. (You will have to provide your server name along with your login credentials and choose the AdventureWorks database.) Then you can drill down and open up the stored procedures folder. Next, right click on the procedure you wish to debug and choose Step Into Stored Procedure from the context menu. Then you are ready to start debugging!
http://searchsecurity.techtarget.com/generic/0,295582,sid87_gci1197457,00.html
http://searchsecurity.techtarget.com/generic/0,295582,sid87_gci1197457,00.html
Web Parts
http://www.ondotnet.com/pub/a/dotnet/2005/05/23/webparts_1.html
http://www.ondotnet.com/pub/a/dotnet/2005/01/10/liberty.html
http://blogs.neudesic.com/blogs/pete_orologas/archive/2006/06/14/162.aspx
Register DB
The Solution: (3 simple steps)
1) Open your visual studio command prompt located in "Start Menu\Programs\Microsoft Visual Studio 2005\Visual Studio Tools\Visual Stuido 2005 Command Prompt" and type in aspnet_regsql.exe. This will launch a wizard so that you can either create a DB or add tables to an existing database for storing personalization infromation. Click Next, Next, then enter in your DBServer Name. Lets leave the DB as "default" for now, click next, next, finish. By leaving the db as default the tool will create a database named aspnetdb
2) Now we have a database so we will need a connection string to access it from our Personalization Provider in Step 3. The connection string will go into your web.config and it will be similar to the one show below:
Note: The "remove" tag is used to inform Visual Studio that we will not be using SQL Express
3) The final step is to add our own personalization provider in the section of the webConfig. The personalization provider will point to the store we created by using the connection string we provide (Dbconn).
type="System.Web.UI.WebControls.WebParts.SqlPersonalizationProvider"
connectionStringName="DBConn"
applicationName="/" />
http://www.ondotnet.com/pub/a/dotnet/2005/01/10/liberty.html
http://blogs.neudesic.com/blogs/pete_orologas/archive/2006/06/14/162.aspx
Register DB
The Solution: (3 simple steps)
1) Open your visual studio command prompt located in "Start Menu\Programs\Microsoft Visual Studio 2005\Visual Studio Tools\Visual Stuido 2005 Command Prompt" and type in aspnet_regsql.exe. This will launch a wizard so that you can either create a DB or add tables to an existing database for storing personalization infromation. Click Next, Next, then enter in your DBServer Name. Lets leave the DB as "default" for now, click next, next, finish. By leaving the db as default the tool will create a database named aspnetdb
2) Now we have a database so we will need a connection string to access it from our Personalization Provider in Step 3. The connection string will go into your web.config and it will be similar to the one show below:
Note: The "remove" tag is used to inform Visual Studio that we will not be using SQL Express
3) The final step is to add our own personalization provider in the
type="System.Web.UI.WebControls.WebParts.SqlPersonalizationProvider"
connectionStringName="DBConn"
applicationName="/" />
Subscribe to:
Posts (Atom)