Posts

cshtml binding js function with boolean parameter using model

Hi, I recently faced this issue while binding Model.boolvariable as a parameter to js function. it was not getting passed as expected but always received 'onclick' the event name which was getting bind. here is the sample I was struggling with: <a href="" class="OpenDataTablePopup" style="font-weight:bold" onclick="javascript: ShowTBL(@Model.intfield, @Model.IsDefaultData ); return false;">Edit record</a> After several tries with trial and error I got this solution, which I wasn't aware of: <a href="" class="OpenDataTablePopup" style="font-weight:bold" onclick="javascript: ShowTBL(@Model.intfield, @Model.IsDefaultData.ToString().ToLower() ); return false;">Edit record</a> Just adding this info, as someone might save some time. Happy coding!!!

SQL SERVER 2008 Installation issues

There are few common issues caused during the installation of SQL Server 2008, out of which some are difficult to solve using internet surfing.... One of them which I faced lot of time is "%1  not a win32 application" - this occurs while installing SQL Server 2008, and the module is "Database Engine"... I am not sure but this may happen with other applications also. While installing I figured that I was installing the sql server 2008 with "Option" set to support 64 bit, which was obvious as my OS was win 7 ultimate 64bit. Then after trying a lot I just changed the option from 64bit to x86, and voila!!! the installation completed successfully... Thats it....Happy coding :)

CodeSmith Customization - Dynamic ConnectionString Login user based

Well finally I got through a way to modify the CodeSmith generated layers to support Dynamic Switching of ConnectionString based on the user logged in. That means, if we want to allow few users to access a particular database, and other users to access some other database, here is what I did.....   In Services Layer there is a Class "ConnectionScopeBase" which has this public property DataProvider. I noticed this property was called whenever there was a database call. So I placed my logic into the "get" method of this property: I already initialized a session variable when the user tends to login, and kept this user name in a separate text file, which is read when user clicks on Login button. As soon as the username is matched with the one saved in textfile, the session object is initialized with the alternate connectionstring which I place again in text file....  :-) so now, which ever database call comes in it verifies the session object, if exist th

RDLC Error The report definition for report 'xxxxxx' has not been specified

Hi, I was wondering around Google to find the exact solution for "The report definition for report 'path of rdlc file' has not been specified. Got several things but no luck.....then I just went through all the properties of ReportViewer and then the ReportViewer1.LocalReport, there I found the RaportPath property which was not set while doing the Dynamic Report Binding. I was using the below Code: rvAll.ProcessingMode = ProcessingMode.Local; rvAll.LocalReport.ReportEmbeddedResource = Server.MapPath("rprtsalesBill.rdlc"); ReportDataSource rds = new ReportDataSource("inventorycontrolDataSet_tblSales",  objSalesBillList);  rvAll.LocalReport.DataSources.Clear(); rvAll.LocalReport.DataSources.Add(rds); rvAll.LocalReport.Refresh(); And after analyzing the properties of LocalReport I added the below line of code rvAll.LocalReport.ReportPath = Server.MapPath("rprtsalesBill.rdlc"); just before the ReportEmbeddedResource line. A

Custom Code in Microsoft RDLC Report

Hi, This is the copied code available in several forums (All are same). Only thing is the same code was not working for Custom code in Report - Properties - Code Section. so here is the complete / debugged and successfully running code snippet: _______________________________________________________________________ Public Function changeCurrencyToWords(numb As [String]) As [String] Return changeToWords(numb, True) End Function Public Function changeCurrencyToWords(numb As Double) As [String] Return changeToWords(numb.ToString(), True) End Function Private Function changeToWords(numb As [String], isCurrency As Boolean) As [String] Dim val As [String] = "" Dim wholeNo As [String] = numb Dim points As [String] = "" Dim andStr As [String] = "" Dim pointStr As [String] = "" Dim endStr As [String] = "" If isCurrency Then endStr = "Only" Else endStr = "" End If 'endStr = If((isCurrency), ("Only&

Visual Studio vulnarable behaviour

Most of us do sometimes face this situation where the VS IDE behaves unexpectedly out of order. And most of the time this problem is solved by just one resetting command, follow the below steps: 1. Navigate to Start -> Program Files -> Microsoft Visual Studio 2008 -> Visual Studio Tools -> and click on Visual Studio 2008 Command prompt.     This goes with all versions of VS, VS 2005, VS 2008 and VS 2010 2. Type in the following command:         devenv /resetskippkgs     and press enter, your VS IDE will open as fresh and all working. Happy Coding....   :)

Template missing from Add New Items

Due to some installation problems or re-installation some templates either skipped by installation of removed by mistake. To bring back the templates follow below steps: 1. Close Visual Studio IDE. 2. Navigate to  Start -> Program Files -> Microsoft Visual Studio 2008 -> Visual Studio Tools and click on Visual Studio 2008 Command Prompt. 3. In the command prompt type in the below command           devenv /installvstemplates     and press enter.......wait for few moments until the cursor returns to the command prompt. 4. Now all set, just for precaution type in another command to resetskippkgs as below:          devenv /resetskippkgs     and press enter, VS 2008 IDE will be opened. Now check for the Templates via - File -> New Website / Project  OR Right click on your solution/project in solution explorer and click on Add New Item. Happy Coding.... :)