This blog shares my journey as a software engineer, along with personal reviews and life experiences I’ve gained along the way. “I have not failed. I've just found 10,000 ways that won't work.” — Thomas Edison. If you enjoy my content, please support it by clicking on ads (free for you, big help for me!) or by buying me a coffee on Ko-fi. Thank you!
Wednesday, August 31, 2011
MOSS 2007 on Windows Server 2008 R2
Next was installing MOSS 2007 SP2 slip stream on the rest of the farm. Ensure you open the port that Central Admin is installed on or you will not be able to access. LESSONS LEARNED FROM MOOJJOO
Saturday, March 26, 2011
Friday, November 19, 2010
Add JavaScript to handle two scripts in ASP.NET
{
System.Text.StringBuilder sbValid = new System.Text.StringBuilder();
sbValid.Append("if (confirm('Are you sure you want to post this file to app') == true){");
sbValid.Append("this.disabled = true;");
sbValid.Append("} else { return false;}");
sbValid.Append(this.ClientScript.GetPostBackEventReference(this.btnPostToIRIS, "") + ";");
this.btnPostToIRIS.Attributes.Add("onclick", sbValid.ToString());
}
Tuesday, November 09, 2010
Looping through SQL Server ... This has to be saved. To many hours spent.
This article describes various methods that you can use to simulate a cursor-like FETCH-NEXT logic in a stored procedure, trigger, or Transact-SQL batch.
Use Transact-SQL Statements to Iterate Through a Result Set
There are three methods you can use to iterate through a result set by using Transact-SQL statements.
One method is the use of temp tables. With this method, you create a "snapshot" of the initial SELECT statement and use it as a basis for "cursoring." For example:
/********** example 1 **********/
declare @au_id char( 11 )
set rowcount 0
select * into #mytemp from authors
set rowcount 1
select @au_id = au_id from #mytemp
while @@rowcount <> 0
begin
set rowcount 0
select * from #mytemp where au_id = @au_id
delete #mytemp where au_id = @au_id
set rowcount 1
select @au_id = au_id from #mytemp
end
set rowcount 0
A second method is to use the min function to "walk" a table one row at a time. This method catches new rows that were added after the stored procedure begins execution, provided that the new row has a unique identifier greater than the current row that is being processed in the query. For example:
/********** example 2 **********/
declare @au_id char( 11 )
select @au_id = min( au_id ) from authors
while @au_id is not null
begin
select * from authors where au_id = @au_id
select @au_id = min( au_id ) from authors where au_id > @au_id
end
NOTE: Both example 1 and 2 assume that a unique identifier exists for each row in the source table. In some cases, no unique identifier may exist. If that is the case, you can modify the temp table method to use a newly created key column. For example:
/********** example 3 **********/
set rowcount 0
select NULL mykey, * into #mytemp from authors
set rowcount 1
update #mytemp set mykey = 1
while @@rowcount > 0
begin
set rowcount 0
select * from #mytemp where mykey = 1
delete #mytemp where mykey = 1
set rowcount 1
update #mytemp set mykey = 1
end
set rowcount 0
-- ================================================
-- Template generated from Template Explorer using:
-- Create Procedure (New Menu).SQL
--
-- Use the Specify Values for Template Parameters
-- command (Ctrl-Shift-M) to fill in the parameter
-- values below.
--
-- This block of comments will not be included in
-- the definition of the procedure.
-- ================================================
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: Robert Dannelly
-- Create date: 11/09/2010
-- Description: Resubmission Validation
-- =============================================
CREATE PROCEDURE ResubmissionValidation
-- Add the parameters for the stored procedure here
@ImportID int
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Insert statements for procedure here
DECLARE @ResubmissionTest TABLE
(
[ImportMetricID] [int] NULL,
[ImportID] [int] NULL,
[MetricInstanceID] [int] NULL,
[MetricValue] [varchar](100) NULL,
[NDTR] [varchar](20) NULL,
[MetricValueDate] [datetime] NULL,
[Narrative] [varchar](300) NULL,
[Resubmission] [varchar](50) NULL,
[ImportMetricStatus] [varchar](50) NULL,
[ImportFailureMsg] [varchar](200) NULL,
[CurrentMetricValue] [varchar](50) NULL
)
INSERT INTO @ResubmissionTest (ImportMetricID, ImportID, MetricInstanceID, MetricValue, NDTR, MetricValueDate, Narrative,
Resubmission, ImportMetricStatus, ImportFailureMsg, CurrentMetricValue)
SELECT ImportMetricID, ImportID, MetricInstanceID, MetricValue, NDTR, MetricValueDate, Narrative,
Resubmission, ImportMetricStatus, ImportFailureMsg, CurrentMetricValue FROM tblImportMetric WHERE ImportID = @ImportID --Need to change to Variable
-- This is used for Testing RBD
--SELECT * FROM @ResubmissionTest
DECLARE @ImportMetric_ID char(11), @Resubmission varchar(10)
SELECT @ImportMetric_ID = min(ImportMetricID) FROM @ResubmissionTest
--Begin LOOP
WHILE @ImportMetric_ID is not null
BEGIN
DECLARE @MetricInstanceID int,
@MetricValueDate DateTime
SELECT @MetricInstanceID MetricInstanceID FROM @ResubmissionTest WHERE ImportMetricID = @ImportMetric_ID
SELECT @MetricValueDate MetricValueDate FROM @ResubmissionTest WHERE ImportMetricID = @ImportMetric_ID
-- Be sure to change the values to @MetricInstanceID AND @MetricValueDate
EXECUTE ImportCheckResubmission @MetricInstanceID, @MetricValueDate, @Resubmission OUTPUT
IF @Resubmission = 'Yes'
BEGIN
UPDATE @ResubmissionTest
SET ImportFailureMsg = 'There is an existing value for this metric and interval. Please indicate if it is a resubmission.'
WHERE ImportMetricID = @ImportMetric_ID
SELECT @ImportMetric_ID = min(ImportMetricID) FROM @ResubmissionTest WHERE ImportMetricID > @ImportMetric_ID
END
END
DELETE FROM tblImportMetric WHERE ImportID = @ImportID
INSERT INTO tblImportMetric (ImportID, MetricInstanceID, MetricValue, NDTR, MetricValueDate, Narrative,
Resubmission, ImportMetricStatus, ImportFailureMsg, CurrentMetricValue)
SELECT ImportID, MetricInstanceID, MetricValue, NDTR, MetricValueDate, Narrative,
Resubmission, ImportMetricStatus, ImportFailureMsg, CurrentMetricValue FROM @ResubmissionTest WHERE ImportID = @ImportID --Need to change to Variable
--This is used for Testing
--SELECT * FROM tblImportMetric
END
GO
Thursday, November 04, 2010
Demystify SQL Debugging with with Visual Studio
http://www.asp.net/data-access/tutorials/debugging-stored-procedures-vb
#1 Connect using Windows Authentication as the same account on the local machine that must have sysadmin rights in the Instance of SQL Server.
#2 They use Server Explorer and connect with that same account and then once connect right click on the DB and check "Application Debuggin. I am posting this to my blog.
Great posts. By the way I feel the pain of remote individuals, my answer tell you management that if you want fast, rapid code to fork up the dough for SQL Developer Edition and do all you coding locally with a quality source control.
Robert.
Tuesday, October 19, 2010
Add Using for Controls or lookup very useful
Reboot Remotely
Replace x.x.x.x with the IP address or computer name of the remote machine. -r option is for restart, don't use -r if want to just shut down the system.
Thursday, August 05, 2010
SharePoint Site Collection Administration
Thursday, June 17, 2010
AJAX Install
1) Download the latest version from CodePlex for AJAX.
2) Extract to a location of your choice
3) Add the AjaxControlToolkit.dll & AjaxControlToolkit.pdb to you Web layer project /bin folder
4) Create a new Tab in your Toolbox and point to the new AjaxControlToolkit.dll
5) Create a reference to your AjaxControlToolkit.dll
6) Finally ensure the line in your Web.config is that same version as your dll assembly -
Friday, April 16, 2010
Visual Studio 2010
SharePoint and SQL Sever Reporting Integration
This will be the first implmentation at my company and I very excited to have a fantastic presentation for my upper managment.
A lot of work has been put into this and I plan to sell this great feature.
Thursday, April 01, 2010
New Trick Envrionment Variables
You can right click on your computer > Advanced Tab > set the variables. Warning they will not take effect till a reboot.
This would not worth using for a hosted appllication when you do not have access to the server.
Monday, March 08, 2010
Time to build the app
Define - 20 more hours
- Design DB (Completed)
- Design Workflow (Completed)
- Design UI(s) All screens (Completed)
- Design Objects (Completed)
Measure - 10 hours (2-6 Months, but will be done before I am 40 :-) )
Analyze - 40 hours (Done)
Improve (Build) - (In Process)
- Database Development (8 Hours Completed)
- Application (Web to start in Progress 2-6 months
* Web UI
* Business Layer
* Data Layer (Completed)
* Test Test Test fix fix fix test test test
* Demo to friends and family (Huge Milestone - break out Beer and Wine)
Control - Will know after Improve Phase)
Friday, February 19, 2010
Trace.axd
<trace enabled="true" requestLimit="40" localOnly="false" />
Very important when troubleshooting:
http://msdn.microsoft.com/en-us/library/y13fw6we%28VS.71%29.aspx
Thursday, February 04, 2010
Kill Task in XP
Force kill aspnetwp.exe....
Than stop the IIS and then delete temporary files.
Monday, January 11, 2010
Ctrl-Alt-Del on remote desktop aka server
Ctrl+Alt+End
Friday, October 30, 2009
Database Design and Audit
When developing ASP.NET application that use a APP Pool and identity to make all calls to the back end database in order to have a trigger based solution for auditing.
I would recommend all your tables have updatedDT and updateBY columns in all the tables you want to audit.
Tuesday, September 15, 2009
Leading a Development Team
Depending on the scope of the technical requirements, it is the job of the team lead to review all documentation. PERIOD. From the technical specs the DEV LEAD develops the HLD/LLD specs, make estimates on the Business Analysis for each HLD/LLD.
Next, grant the developer the proper time to analyze the HLD/LLD requirements written by the tech lead. Tech Lead should read the HLD/LLD to ensure they are complete and time the review time and add 1 hour to allow developer the time needed to read the documentation and allow time the developer to ask questions to close gaps on missing requirements.
Once the business and the tech lead sort out these issues a developer should not code until all gaps are filled.
If you do, you will be doing rework on the project, thus costing time which as we all know == MONEY.
Wednesday, July 22, 2009
Team work
Wednesday, April 29, 2009
Assignments
DUhG
If you see that something does not work in Visual Studio because it is not set as an assignment on a property.
Include the = symbol.
Example
li.select;
Will not work
li.select = true; //will.