asp.net

Error converting data type varchar to bigint. Inline sql statements

Hello, This is the code i have used to get LocationID from database with MerchantID. I am getting an exception from Fill dataset part. Please help me out,. The error is Error converting data type varchar to bigint. public DataSet getLocationID(long MerchantID) { //long LOCID = null; try { SqlParameter[] parameters =...

How to get CommandArgument value in Page_Load i.e. before OnItemCommand event

I have a Repeater that generates a list of LinkButtons. Each LinkButton has a distinct CommandArgument value. For various reasons I need to check the CommandArgument value in my Page_Load code (if Page.IsPostBack), i.e. before the OnItemCommand event where it would usually be checked. I have tried accessing the __eventtarget and __event...

Cannot access my UI controls in C# code. What's wrong?

I cannot access my UI controls on my ASP.Net website. When I create a brand new form and drag a control on it, I can use C# to change the properties of the control easily, like one would expect. But when I try to do the same on another page, I cannot access any control whether I drag a new control on the page or not. It seems the code...

Working with links asp.net mvc2

How do I make a static link in a view? (using ASP.NET MVC2) I am working on the site navigation, and have basically 4 main areas. These are split into sub areas, and one controller looks after the entire "main area". So basically after clicking on a main area, i'd like to display a list of links to the different sub areas. I created th...

Restricting the values of nvarchar column using dynamic data entities

Hi, I am using ASP.NET Dynamic Data Entities project to generate a web application for my database. I was wondering what is the easiest way to restrict the allowed values for a column without changing the database structure to make that column a foreign key or modifying the database in any way. For example. I have a table called Assets...

ASP.NET MVC partial in a Portable Area not found

I'm trying to include a partial in a view. Both the partial and the view are in an MVC Portable Area. Here's the code in the view: <% Html.RenderPartial("Here"); %> Here's the partial (named Here.ascx and located in the Shared folder of my portable area): <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<dynamic>" ...

How to send values to crystal report

I want to print the values on crystal report that user input on the asp.net webform. On my form i have few textboxes, radio button list and couple of gridviews. Im not sure how to send these values to crystal report? Im using asp.net 3.5 and .Net builtin crystal reports. ...

Scaling an hosted ASP.NET application

Dear all! We are currently finishing a web-based time-tracking software built on ASP.NET and WCF (for different desktop-clients). Our customers can register an account and add an unlimited number of users to their account. Pricing is tied to the number of active users in the companys account. To keep things simple and easily scalable ...

Legacy activeX control calls DLL functions - I need help

Hint: this one might sound complicated, because I am trying to give as much info as possible, but I suspect that I just want someone to tell me "yes, you are correct". On this legacy system, which dates from 2002, the user visits a web page and uses an RFID reader to read a tag number, which is then written to an input field on the web ...

Select Only Fourth Sunday of each month

Hi, I am stuck for sometime now, now need your help. I want to display in a dropdown only fourth Sunday of each month, say from 1-Sep-2010 to 31-Aug-2011 I only want fourth Sunday in dropdown list, how to do it using asp.net C# Regards ...

ASP.NET HttpApplication local storage

I need some HttpApplication local storage. I thought the ApplicationState was the place for this, but apparently this may be shared across HttpApplication instances in an Appdomain. public class MyHttpModule : IHttpModule { private object initializingLock = new object(); private static HttpApplication last; ...

Cache key causes error "Negating the minimum value of a twos complement number is invalid."

This is one of the strangest errors I've ever seen. I'm doing a very simple call to return values from the HttpRuntime cache. The call is: return HttpContext.Current.Cache[cacheKey]; If it returns null, that's fine. I check if the returned value is null and act accordingly. I've been using this call for a long time. Recently, for...

asp.net Output Encoding?

I'm not even sure i'm calling this the right thing. I'm just starting to get into ASP.Net and of course i'm starting to see syntax like <% "Code here" %>. So far i've seen <%: %>, <%= %>, <%# %>. Of course google doesn't like these symbols for searching so searching for help is futile :). Maybe this type of syntax is back from classic AS...

Find out deselected item in a CheckBoxList ASP.NET

I have a CheckBoxList with a SelectedIndexChanged event, where I add the Value of the selected ListItem to a variable. I want to substract the Value when the item is unchecked. I tried SelectedIndex but returns -1 and SelectedItem returns null. And the EventArgs argument doesn't have any data to help... ...

asp.net TreeView Expand question

Hi guys, hope you help me with I think a simple TreeView Expand problem. I have a TreeView control in my MasterPage and my default depth is 2 and I see that when I click on the deeper node it keeps expanded.. But when I redirected into another page, the node collapsed. I have a problem with my code which suppose to keep the node expand...

specified cast is not valid error on development but not on test server

I have a .Net 2 solution with some asp classic pages. I get a specified cast is not valid error when I access the page on my local. Below is the vb function where I get the Error: Public Function Retrieve(ByVal vntSeqId As String, ByRef vntPart As String, ByRef vntPartKey As String, ByRef vntEntDate As String _ , ByRef vntStat...

Use of module private member instead of Application or Cache object in ASP.NET project

In an ASP.NET web app written in VB.NET, I need to load and store a large read-only hash table that is frequently accessed by the application. It only needs to be loaded once on application start, is never updated and can be accessed by any session at any time. If I load the hash table into a private member in a (global) module, a look...

ASP.NET Master page DefaultButton override

I have a master page with a form element and the defaultbutton attribute set to a server-side ImageButton. On one of my pages I want to "override" the masterpage defaultbutton attribute by setting the Forms DefaultButton in the Page_Load event. i.e On mater page: <form id="form1" runat="server" defaultbutton="btnSearch">....</from> ...

Disabling the button disables the form

I have set of controls to select the search criterias and below that there is gridview with text box. And below that there is submit button in the form. On certain condition iam disabling submit button on on blur event of the textbox inside the gridview. But it disables the form itself. When i open some other window or alt+tab enabling t...

How to pass values to a view in sql server

I have created a view called business this runs sucessfully ,but the problem is how will i use dynamic values in place of 12.925432,77.5940171 ,I want to pass parameter in sql query from c# code behind. create view [dbo].[business] as SELECT Id, Name1, ZipCode, StreetName, StreetNumber, State1, ...