Currently Browsing: .Net

Changing the target framework for the setup file

One of my team member, kunal, was facing a problem while creating the setup project for v 20 using VS 2008. Even after just changing the target framework while creating the project did no help so had to search for the solution, and the solution that solved our problem is as follows, 1) Create a windows application project with target framework as v2.0 Select Target Framework 2) Create Setup and deployment project and select target framework as v2.0 Target Framework for Setup 3) Right-Click on setup project Name and select Properties, under properties select Prerequisites Select Prerequistes ...
read more

ASP.Net menu control not working in Google Chrome

ASP.Net menu controls breaks in Google Chrome and works fine in other browsers. Here is the hack to make it work in Google Chrome as well, if (Request.UserAgent.IndexOf("AppleWebKit") > 0) Request.Browser.Adapters.Clear(); Just add this code on your page load and the menu control will start working fine in Google Chrome as well. Also some times the hover menus don’t work on IE8 to make it work on IE8 you need to set “z-index” in DynamicMenuStyle property of the menu control. Hope this helps
read more

SharePoint Error: “The language-neutral solution package was not found”

Last night while developing an event listener custom list, I ran into this error, SharePoint Error: “The language-neutral solution package was not found” The solution to this problem is, Restart your visual studio. And it will be back to normal. Hope this helps
read more

Cannot create/shadow copy when that file already exists

The .Net Framework has a feature called Shadow Copy. Shadow copy is enabled on every appdomain created by ASP.NET by default. By default assemblies loaded will be copied to a shadow copy cache directory, and will be used from that location. But this may create problem sometimes.
read more

Export grid values in excel

Following code helps you to import grid values to excel, //Import System.IO in your application for StreamWriter Object //note: excel_file represents the complete physical address of excel file eg C:/myexcel.xls public void export_datagridview_to_excel(DataGridView dgv, string excel_file) { int cols; //open file StreamWriter wr = new StreamWriter(excel_file); //determine the number of columns and write columns to file cols = dgv.Columns.Count; for (int i = 0; i < cols; i++) { wr.Write(dgv.Columns[i].Name.ToString().ToUpper() + “\t”); } wr.WriteLine(); //write rows to excel file for...
read more
Page 1 of 1112345Last »