asp.net

Error 'Connection property has not been initialized'

I am getting error ExecuteReader: Connection property has not been initialized. below is the code i am using. SqlDataReader oReader = new SqlDataReader(); string sSQL = @" WITH TAB_CTE AS ( SELECT fbominum, fbompart, fparinum, flevel, fsono FROM sodbom WHERE fbompart= @fbompart and fsono = @fsono UNION ALL SELE...

How to get Router Name & IP as shown in Windows Network Tab? (in Code)

Basically, if you go to Start and click Computer and then click on the Network link on the left hand side, you'll notice on the right hand side several categories, one of which is titled "Network Infrustructure", in that category, my router is listed, and in my case, it is "LINKSYS WAG160N Wireless-N ADSL2+ Gateway" and when you right-cl...

Multiple Line continuation in VB.NET IDE (Visual Studio 2010)

i notice that when i start next line of code and i press enter, it recompacts itself and the continued line moves left a bit... then if i place focus on the second line and press enter again, it (the second line) moves to the left some more, and it keeps doing this every time i focus on second line and press enter. this is as you can ima...

Primary key violation constraint

string sqlInsert = "Insert into account_details( account_number, account_type, transfer_access_code, account_balance, customer_id) SELECT account_number, account_type, transfer_access_code, account_balance, customer_id from customer_details"; This query just takes data from customer ...

Catching a custom Exception thrown by a WebMethod on ASP.NET WebService

I have a classical asp.net web service (asmx) and a web method in it. I need to throw a custom exception for some case in my web method, and I need to catch that specific custom exception where I call the web service method. [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] pub...

Not calling Response.Flush still sends Connection: Close in the Response

I was under the impression that not calling Response.Flush would ensure that Connection: Close would not be returned. So how do I return Connection: Keep-Alive? I am using the following code to return a file from ASP.NET. Response.ContentType = type; Response.AppendHeader("Content-Length", bytes.Length.ToString()); Response.Cache.SetCa...

ASMX Web Service - Return user defined class with properties

Hey, I am trying to return a user defined class from a web method. The class has properties and/or methods. Given the following web method: [WebMethod] public List<MenuItem> GetMenu() { List<MenuItem> menuItemList = new List<MenuItem>(); menuItemList.Add(new MenuItem()); menuItemList.Add(new MenuItem()); me...

Potential problems with using ASP.NET App cache on mirror?

I've 2 servers mirror with a load balancer. I'd like to know the pros and cons of sticking with app cache versus going with something like memcache? I'm very interested in various solutions and especially the types of errors that I could get or limitations by not synchronizing them. To start the discussion, I'd hazard that using ASP.NET...

calling asmx web service from jQuery

Hi All, I am not able to call web service(asmx) from jQuery function. It is saying "access denied" error while calling web service. It is working in the dev and local machine but I am getting the same error. Here is my ajax call $.ajax({ type: "POST", url: "http://server.com/calculator.asmx/calculus", ...

disable auto logout feature in asp.net

Im using forms authentication. I want my application should not logout the user automatically after sometime. ...

ASP.NET TreeView and loading data on demand

Is there a way to force TreeView to load data on demand? In the other hand TreeView must load data only when a node is to be collapsed. TreeView is binded to a collection of data that is implementing IHierarchyData. ...

Losing my session variables - What exception might cause sessions to be lost?

Hello, I have health monitoring enabled on a production system (asp.net webforms .net 4) and I see that there's a lot of errors being sent to me indicating that a session variable has been lost. (I am trying to attach something out of session state to a entity framework data context and get a "Value cannot be null, parameter name entit...

add user page to a hosted website

I have a website that my company hosted using hubspot.. now the guy who made it is gone.. Currently all the code is in the front end which i think was made by using the CMS tool of hubspot. What i need to do is add another page to this website which has my code and also has a backend code in it. Plese help me how do i proceed.. i am c...

ASP.NET read content from pdf and display on webpage page by page

Hey as the title suggests is this possible ? i.e I point code to a pdf and then for example go give me contents of page 1, and then display the content of this page on the webpage ? If yes how would this be returned, i.e formatting or how would images be returned cheers ...

JS: "The callee (server [not server application]) is not available and disappeared." accessing window.opener

In our (quite large and old) ASP.NET application we use a lot of pages loaded into frames, iframes, and modal dialogs (using window.showModalDialog). We are starting to see the error above quite a bit, and I can't seem to find a single rational explanation for it anywhere. Popup Blockers. Nope. We're not running them. Not even the buil...

Detailsview Keeping items after inserting, not able to increment?

I have a checkbox that allows users to keep the input in a detailsview to help if they are inputting many similair items. I'd like one field to increment, but it won't take. I've even tried putting it in a hidden field. Incrementing field: Protected Sub DetailsView3_ItemInserted(ByVal sender As Object, ByVal e As System.Web.UI.WebContr...

user default column value in INSERT stored procedure

From my ASP.NET application I am calling an INSERT stored procedure, there is a default value for one of the columns in the table that the INSERT procedure places the data into. How do I specify that I want the default value to be used instead? (Or do I have to specify the actual default value in my parameters) SITUATIONAL TABLE: Colum...

S#arp Architecture and CRUD Scaffolding

I'm pretty sure I am a bit confused here (I'm even confused about being confused). I've already created my database in SQL Server 2008. I'm now trying out S#arp Architecture for the first time and I'm was looking into using CRUD scaffolding. From the instructions it seems like I basically have to RECREATE the entire database within the...

How do i use System.Net.NetworkInformation.GatewayIPAddressInformation Class?

I tried every trick in the book, creating a new object, instantiating it (even tho it says i can't) and just trying to create a reference to use it, and then also trying to call the .Address value inside it while using it like i would use a shared member (without instantiation) and nothing is working, msdn sample/help is useless... i eve...

Massive ScriptResource.axd - is this caused by ASP.NET AJAX?

I'm running fiddler against my live website which uses a bit of ASP.NET AJAX and a bit of query. I'm noticing a MASSIVE ScriptResource.axd file of 300KB Starts off like this // Name: MicrosoftAjax.debug.js // Assembly: System.Web.Extensions // Version: 3.5.0.0 // FileVersion: 3.5.30729.196 //------------------------------...