this blog contains information for .net and sql stuffs. You can find various tips and tricks to overcome problem you may be facing in ...
Tuesday, December 18, 2012
Windows 8 application development requirement
Monday, October 1, 2012
Add Event/Appointment in Google Calendar with Google account credential.
Friday, September 7, 2012
Html.RenderPartial() Sytanx Error : No overload for method 'Write' takes 0 arguments
Hey Everyone,
I was trying Html.RenderPartial() in Asp.net MVC and what I got “No overload for method 'Write' takes 0 arguments“
From my code it seems very clear that I have written correct syntax but actually there is a little problem with it.
My earlier code was is as below
@foreach (var p in Model.Members)
{
@{ Html.RenderPartial("MemberSummary",m); }
}
But it was giving me Error : “No overload for method 'Write' takes 0 arguments”. As we all know RenderPartial() directly writes in the output stream so it was better for using it than Partial().
After close look inside of code, I found that it should be C# statement and I was mixing inside of code block and I corrected out my code as below. It worked.
@foreach (var p in Model.Members)
{
Html.RenderPartial("MemberSummary", m);
}
Have a happy debugging !!
Monday, July 30, 2012
Windows Mobile 7.5 on my view.
Monday, July 2, 2012
Green field / Brown field development
In software development we are usually have two types of work to be done in any application. Both some legacy system is already running and we should require build on new system on it or build new system from very scratch.
When we are going to build new system without considering any of the old system and it does not connect with any other system such type of development referred as Green Field development
In contrast some system does not require depending on any other system, we can go ahead with development from scratch, we don’t rely on any other system such type of development referred as Brown Field Development.
Both type of development have their advantage and disadvantage on development.
Green Field:
Advantage
We have more control at the time of development,
We don’t rely on sub system.
We are free to stretch system as we need
Disadvantage
No reference is available, new system should build carefully meet all requirement of business.
Brown Field:
Advantage
Have reference of already running system
Can take advantage of existing data for future expansion
Can leverage system incorporate with new System.
Disadvantage
Hard to implement programming semantics at some level due to bound with old system.
We do many application but we might not know what type of development we do? Hope this will help us identifying our development.
Wednesday, June 6, 2012
Print button is not working in Crystal report viewer
Tuesday, June 5, 2012
Change default time out of strongly typed dataset table adapter command.
Public Sub SetCustomCommandTimeout()
Utility.SetCommandTimeout(CommandCollection)
End Sub
End Class
If (commands IsNot Nothing) Then
If (timeout < 0) Then timeout = GetConfigTimeout()
For Each cmd As System.Data.SqlClient.SqlCommand In commands
cmd.CommandTimeout = timeout
Next
End If
End Sub
Private Shared Function GetConfigTimeout() As Integer
Dim timeOut As Integer
If Not System.Configuration.ConfigurationManager.AppSettings("CommandExecutionTimeOut") Is Nothing Then
timeOut = CType(System.Configuration.ConfigurationManager.AppSettings("CommandExecutionTimeOut"), Integer)
Else
timeOut = 0
End If
Return timeOut
End Function
Tuesday, May 1, 2012
Do not serialize public property or field in a class
Wednesday, February 22, 2012
Programmatically create folder in SharePoint Document library with client object model
SharePoint 2010 has very strong client object library, with the help of client object model we can almost interact with all document related functionality from our application and can interact with SharePoint 2010.
Below is some code snippet for creating new folder in the SharePoint Document Library.
public bool CreateSPFolder(string libname, string correspondance)
{
bool bolReturn = false;
ClientContext ctx = this.GetSPClientContext();
Web web = ctx.Web;
List documentLib = ctx.Web.Lists.GetByTitle(libname);
string targetFolderUrl = libname + "/" + correspondance;
Folder folder = web.GetFolderByServerRelativeUrl(targetFolderUrl);
ctx.Load(folder);
bool exists = false;
try
{
ctx.ExecuteQuery();
exists = true;
}
catch (Exception ex)
{
bolReturn = false;
}
if (!exists)
{
ContentTypeCollection listContentTypes = documentLib.ContentTypes;
ctx.Load(listContentTypes, types => types.Include
(type => type.Id, type => type.Name,
type => type.Parent));
var result = ctx.LoadQuery(listContentTypes.Where
(c => c.Name == "Folder"));
ctx.ExecuteQuery();
ContentType folderContentType = result.FirstOrDefault();
ListItemCreationInformation newItemInfo = new ListItemCreationInformation();
newItemInfo.UnderlyingObjectType = FileSystemObjectType.Folder;
newItemInfo.LeafName = correspondance;
ListItem newListItem = documentLib.AddItem(newItemInfo);
newListItem["ContentTypeId"] = folderContentType.Id.ToString();
newListItem["Title"] = correspondance;
newListItem.Update();
ctx.Load(documentLib);
ctx.ExecuteQuery();
bolReturn = true;
}
return bolReturn;
}
Monday, January 23, 2012
Fix issue HTTP/1.1 200 OK Server: Microsoft-IIS/7.5 Error with a SharePoint 2010 Web Application
Generally, such error comes when we try to browse web-application url. There could be many problems around this problem and depends on it there are different solution for it.
First most common issue around this is that, web application does not contain any site collection at web application root level url, to resolve this you can create site collection from central admin ->Application Management ->Create Site Collection. During creation of site collection, please select your web application where you would like to create.
Second scenario, if you have already site collection created and still this problem occurs. To overcome such problem you have choice to restart IIS, reattach your content database, check services on your pc whether “work station” service is started.
Hope this will help!!
Thursday, January 12, 2012
Prerequisites could not be found for bootstrapping (while upgrading from VS 2005, 2008 to VS 2010)
When you try to add prerequisites, you will be surprised that it will not find your older version any more. Many forums said that Microsoft has disabled it and you need to upgrade to higher version of prerequisites.
You can see that in the given below images that shows unavailability.
To resolve this issue you need to copy boots trapper files.
Older version of VS files can be found at
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages
You need to copy files from above location to below location and once you copy required folders, you will be able to access those in prerequisites.
C:\Program Files\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages
Cheers!!
Wednesday, January 11, 2012
Adding Footer to SharePoint 2010 Custom Master Page
When you are going to develop custom layout of your SharePoint site, it could be requirement of having footer in the page. V4 master page does not contain any options to set footer in page.
You need to add footer manually to your custom master page.
If you check your master page you will find below line
Just above that line you can add your custom footer section as below sample markup.
Copyright © 2012 Company. All Rights Reserved.
Style for above div
*Customized foooter */
#s4-customfooter{
clear: both;
padding: 10px;
color: #ffffff;
background-color: #4F5E85;
}
Hope this will help!!
Thursday, January 5, 2012
The Project Item "module1" cannot be deployed through a Feature with Farm Scope
You might have faced such error sometime during your deployment of SharePoint projects. Usually this error comes due to lack of availability of particular item in the scope. You have limited items that can be deployed in the scope of web, site, web application and farm level.
Microsoft has prepared a very nice article to list out it. You can check out here