Sharepoint search in document library/list programmatically (using C#)

In sharepoint, it is generally required to limit search to a particular list or document library and display metadata properties. The example below shows an example FullTextSql query using the PATH managed property to limit your search to a particular list, and then the results are used to create the list item. You can bind results to gridview and can show metadata properties.You need to pass document library url and search text in the following method:

String to DateTime, FormatException and ASP.NET

There are lots of bugs/errors due to improper handling of datetime. Sometime we don’t know the production server regional settings or the culture information. It may different from the development area. Thus this yields the errors on deployment if not handled properly. See one example:

Display Hierarchical Data with TreeView in ASP.NET 2.0

When there are no Large Amounts of Data then it is not good to connect database, fetch data and add to treeview node again and again for child/sub nodes. It can be done in single attempt. In following example, ID=-1 for root nodes.

Add Dynamic Buttons and Handle click event on server side in ASP.NET

Generally, it is required to generate buttons dynamically. Suppose user selects some items we have show all user selected item in cart where user can reject selected item. So we require to show remove button dynamically. So our object is to generate buttons dynamically and Handle click event on server side.

Create Windows Service quickly using .NET

Generally some tasks are required to be scheduled or dependent on the time. So this can be performed easily using windows service. Here are the steps to create windows service quickly.

Custom role provider based sitemap navigation in

Object: Most ASP.NET Applications implement roles to deal with role permissions and security. Sometimes, it is required to keep existing database structure to manage Roles. So, custom role provider is used for this. Here are the steps to implement navigation based on the custom role provider.

How to set or test connection string

For a developer, the MOST COMMON problem is the database connectivity. The most common reason is wrong connection string. Here are the steps to test connection string and see connection problem.

Create Dynamic DropDownLists in

1. Create dropdownlist dynamically with autopostback property true
2. Keep dropdownlist during postback
3. Maintain selected value during postback.
Here is the sample for this.