Techno Freak Search

Search Results

Wednesday, August 10, 2011

Using SharePoint Data in your LightSwitch Applications


One of the great features of LightSwitch is that it lets you connect to and manipulate data inside of SharePoint. Data can come from any of the built in SharePoint lists like Tasks or Calendar or it can come from custom lists that you create in SharePoint.  .LightSwitch provides the ability to connect to multiple data sources like external databases and SharePoint and relate them together. However when you want to present data from multiple data sources on the same screen you need to tell LightSwitch the order in which you want to save this data.


More Details Refer this link


Saturday, July 9, 2011

BCP Utility + Sql Server 2005 / 2008

Hi

This article is based on bcp (Bulk Copy Processing). BCP utility is generally used to transfer large data into own file format.

For More Details you can visit : http://msdn.microsoft.com/en-us/library/ms162802.aspx

This utility is useful to archiving log which is older then 30 days and It will dump all records to the file. If bcp commands run successfully then only delete command will execute and delete all the archiving records from database.
I have created Stored Procedure for Log Archiving. Please find list of advantage of Log Archive Script:

- Run "SQLInsertScriptForBCP.sql" for Creating Dummy Table for BCP.
- User can pass Table Name, No of Days Older, Path and File Name as parameter
- While Archive log if any error is generated then it will log that error and Delete command will not be executed.
- Automatically retrieve server name.
- You can run this utility on schedule also.
-
That's it.

































Download Link
 


Regards
Pritesh Gandhi.

Reference links:

http://sqlfool.com/2008/12/bcp-basics/

Monday, June 6, 2011

asp.net date validation with three drop down list

Hi,
If you want to do date validation on three drop down list  then please find below is reference and Solution.



var minYear=1900;
var maxYear=2100;

function daysInFebruary (year){
// February has 29 days in any year evenly divisible by four,
// EXCEPT for centurial years which are not also divisible by 400.
return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}
function DaysArray(n) {
for (var i = 1; i <= n; i++) { this[i] = 31 if (i==4 || i==6 || i==9 || i==11) {this[i] = 30} if (i==2) {this[i] = 29} } return this } function isDate(strDay,strMonth,strYear ){ var daysInMonth = DaysArray(12) if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
for (var i = 1; i <= 3; i++) { if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
}
month=parseInt(strMonth)
day=parseInt(strDay)
year=parseInt(strYr)

if (strMonth.length<1 || month<1 || month>12){
alert("Please enter a valid month")
return false
}

if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
alert("Please enter a valid day")
return false
}

if (strYear.length != 4 || year==0 || yearmaxYear){
alert("Please enter a valid 4 digit year between "+minYear+" and "+maxYear)
return false
}


return true
}

Retrieve Text and Value of ASP.Net DropDown List + JavaScript

// JavaScript Code

//Diplay the Text and Value of ASP Dropdown List
function DisplayTextAndValueofDropDown() {
var ddlDropDownID = document.getElementById("<%=DropDownList1.ClientID%>");
var DisplayText = ddlDropDownID.options[ddlDropDownID.selectedIndex].text;
var DisplayValue = ddlDropDownID.options[ddlDropDownID.selectedIndex].value;
alert(DisplayText);
alert(DisplayValue);
}


//HTML Code
<asp:dropdownlist id="DropDownList1" runat="server">
<asp:listitem text="TestText" value="TestValue"></asp:listitem>
<asp:listitem text="TempText" value="TempValue"></asp:listitem>
</asp:dropdownlist>

<asp:button id="btnValidation" onclientclick="DisplayTextAndValueofDropDown();" runat="server" text="Click Me"></asp:button>

Tuesday, May 17, 2011

Saturday, March 19, 2011

Solution Do not Retract Or Do not Deploying

When you go to the 'Solution Management' screen of Central Administration and retract a solution (wsp) it seems to retract ok but the status of the solution remains ‘Deployed’. When you try and delete the solution in the GUI you then get an error saying that you must retract the solution first – but it is retracted!So you can say it almost hang mode where you are not able retract or deploying new solution

Please use below Commands for survive

// Disable Feature from Web Application
Disable-SPFeature -Identity FeatureFolderName -url http://sitename
Note : FeatureFolderName you can find from  C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\FEATURES\
Or
You can deactivate Feature from Site  Collection .

// Uninstall Feature from Site Collection
Uninstall-SPFeature FeatureFolderName
Note : FeatureFolderName you can find from  C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\FEATURES\

//Remove Solution from All Web Application
Uninstall-SPSolution -identity TestWebPart.wsp -allwebapplications


//Remove Solution from Central Administration using Force Command
remove-spsolution -identity TestWebPart.wsp.wsp -force

//Again Add Solution
add-spsolution -literalpath C:\TestWebPart.wsp

//Install Solution using Force Command
install-spsolution -identity TestWebPart.wsp -webapplication http://Siteurl -GACDeployment -force

Sharing

Ratings & Review

Total Pageviews

Followers