Build an EntityConnection Connection String (edmx) model connectionstring

Change edmx model connectionstring dynamically in class library (Data Access Layer) // Specify the provider name, server and database. string providerName = “System.Data.SqlClient”; string serverName = “.”; string databaseName = “AdventureWorks”; // Initialize the connection string builder for the // underlying provider. SqlConnectionStringBuilder sqlBuilder = new SqlConnectionStringBuilder(); // Set the properties for the data source. …

Calculate duration of time in crystal reports

Create one formula field give name “tot_seconds” local stringvar array completetime; local numbervar totalseconds; if({dtAttendance.Time}”N/A”) Then ( completetime:=split({dtAttendance.Time},”:”); totalseconds:= ((3600*cdbl(completetime[1])) + (60*cdbl(completetime[2]))+(cdbl(“00”))); ) {dtAttendance.Time} time is a report field which is display time in report. If Check In times agains chechout time not found then display ‘N/A’ and vice versa so that we haven’t calculate …

Create or Remove HTML controls dynamically using javascript

Download Source code: live.com = create-remove-control.zip Create file input control using javascript function addFileUploadBox() { if (!document.getElementById || !document.createElement) return false; var uploadArea = document.getElementById(“upload-area”); if (!uploadArea) return; var newUploadBox = document.createElement(“input”); // Set up the new input for file uploads newUploadBox.type = “file”; newUploadBox.size = “70”; // The new box needs a name and …

Clear HTML File Input

HTML file … … – javascript function function clearFileInput() { var oldInput = document.getElementById(“fileInput”); var newInput = document.createElement(“input”); newInput.type = “file”; newInput.id = oldInput.id; newInput.name = oldInput.name; newInput.className = oldInput.className; newInput.style.cssText = oldInput.style.cssText; // copy any other relevant attributes oldInput.parentNode.replaceChild(newInput, oldInput); }

User Dynamic query for search records and use uniqueidentifier

Declare @SearchText nvarchar(max) set @SearchText = ‘sah.CheckInCheckOutDateTime>=”2011-09-28 10:00:00.000”’ Declare @SchoolYearId uniqueidentifier set @SchoolYearId=’25511F7F-8F87-4085-A242-2004F4419D36′ Declare @Str as nvarchar(max) set @Str=’ select s.LastName +”, ” + s.FirstName as ”Name”,CheckInCheckOut,sah.CheckInCheckOutDateTime as ”ClockOut” from StaffAttendenceHistory sah join Staffschoolyear ssy on sah.staffschoolyearid = ssy.id join Staff s on ssy.staffid = s.id where ssy.SchoolYearId=@i’ If(LEN(ISNULL(@SearchText,0))>0) set @Str = @Str + ‘ …

Attendance Reports CheckIn CheckOut in SQL Server

declare @tb1 table (Id int identity(1,1), Name nvarchar(50), CheckInCheckOut bit, CheckInCheckOutDateTime datetime) insert into @tb1(Name,CheckInCheckOut,CheckInCheckOutDateTime)Values(‘Poter, Harry’,1,’2011-08-30 17:00:15.090′) insert into @tb1(Name,CheckInCheckOut,CheckInCheckOutDateTime)values(‘Poter, Harry’,0,’2011-08-30 17:00:20.140′) insert into @tb1(Name,CheckInCheckOut,CheckInCheckOutDateTime)values(‘Poter, Harry’,1,’2011-08-30 17:00:24.890′) insert into @tb1(Name,CheckInCheckOut,CheckInCheckOutDateTime)values(‘Poter, Harry’,0,’2011-08-30 17:00:29.983′) insert into @tb1(Name,CheckInCheckOut,CheckInCheckOutDateTime)values(‘Poter, Harry’,1,’2011-08-31 17:00:38.983′) insert into @tb1(Name,CheckInCheckOut,CheckInCheckOutDateTime)values(‘Poter, Harry’,0,’2011-08-31 17:00:44.967′) insert into @tb1(Name,CheckInCheckOut,CheckInCheckOutDateTime)values(‘Poter, Harry’,1,’2011-09-01 17:00:54.950′) insert into @tb1(Name,CheckInCheckOut,CheckInCheckOutDateTime)values(‘Poter, Harry’,0,’2011-09-01 17:01:03.590′) –insert into @tb1(Name,CheckInCheckOut,CheckInCheckOutDateTime)values(‘Poter, …