Asp.net - Invalidate A Single Data Item In The .net Cache In VB

Jun 3, 2010

I have the following VB.NET code to set and read objects in cache on a per user basis (i.e. a bit like session)

Public Shared Sub CacheSet(ByVal Key As String, ByVal Value As Object)
Dim userID As String = HttpContext.Current.User.Identity.Name
HttpContext.Current.Cache(Key & "_" & userID) = Value
End Sub

[Code]....

I use these functions to hold user data that I don't want to access the DB for all the time. However, when the data is updated, I want the cached item to be removed so it get created again.

How do I make an Item I set disappear or set it to NOTHING or NULL?

View 1 Replies


ADVERTISEMENT

Data Bound To ListBox - Display Two Data Items As A Single Item?

May 7, 2012

I have an Address Book project with a listbox. The listbox is bound to the database via the little arrow pop-up box in the corner of the listbox. I have the DisplayMember set to FirstName, and obviously only display the First Name of the contact in the ListBox. Is there an easy way to change it so that it displays the First and Last names? I can't change the binding because I need it to get the ID of the record selected.Here's the basis of my code...

Private Sub MainForm_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'CompanyDataSet.Contacts' table. You can move,

[code].....

View 1 Replies

Custom Single-Instance Application - Read-only Cache

Mar 14, 2011

I'm trying to build a single-instance application, but not in the traditional sence. Instead of a simple silent prevention of launching a second application, I want it to send a message to said application so it launches a second mainform in my original process.

(I want some read-only cache (language, style,...) shared, and a few sources like local settings shared, but other then that all resources reside in the mainforms and act as seperate applications.)

(I'm not looking for specific code, more for hints/tips and/or general directions, more specificaly on what parameters do you check process equality, and what method do you use to pass the message? Windows Messages? Sockets? ...)

View 11 Replies

Cached For Exp Use Cache.insert To Cache Each Property ?

Jul 11, 2009

I have the following code in my config.vb file in app folder and almost all of my pages use this code for permormance issues i need to have it cached for exp use cache.insert to cache each property How should i use caching?

BR>Public Class Config

Private _physicalPath As String

Public Property physicalPath() As String

[CODE]..........................

View 3 Replies

How To Cache Real-time Data

Jan 14, 2009

I'm working on a windows forms application (.NET 4.0).My form contains a 'Fast Line' chart using the Microsoft chart control included in VS2010.The chart gets filled with about 20,000 datapoints.My application then starts receiving market data from a server via DDE (Dynamic Data Exchange) in real-time and adds it the chart.

View 5 Replies

IDE :: Add A New Table To A Local Data Cache?

Mar 25, 2010

I'm creating an occasionally connected application with a local (client) .sdf data cache. I added a new table to my server database and want to include this table in my local data cache and synchronization. Is there an easy way to do this?

View 1 Replies

System Data Offline Access Using Cache?

May 19, 2009

We are developing this system that's constantly connecting and retrieving records in our Sql Server 2000 database. The problem is. is that when the database is down we can't use the system. So we are tasked to modify the system to have offline access feature without data replication rather making a xml cache or any flat file data cache.

My question is, what is the most optimized way to make this work?

BTW, the offline data should be synchronized when the server gets online.

View 6 Replies

WinForms App Data Caching - In Which Layer To Cache

Feb 27, 2009

We have data that's updated nightly in a database residing in the same instance as my app's database. So to save on database calls, I want to cache this static-for-the-day data into a List(Of MyObject). From a theory point of view, should this cached List(Of ) be cached in the presentation layer code, via a global variable? Should it be in a global variable in the .DLL?I'm thinking in the .DLL, because I created a service layer, which is exposed publicly to the GUI and makes calls to the data access layer inside the .DLL:

Public Shared Function Search(ByVal criteria As Core.Other.Customer) As List(Of Core.Other.Customer)
' TODO: Check the customer cache to see if it has been populated yet. If not, populate it.
If 1 = 1 Then

[code]....

View 3 Replies

VS 2008 Retrieve Data And Again It Create Cache Folder

Jan 23, 2012

I have programme which contains two list box. when exe is launched it retrieves data from web references [from web services] and immidially it creates folder of cache so when next time exe. is launched it displays data so fast in listboxes. and if cache folder is deleted and exe. is again launched it takes some time to retreave data and again it create cache folder.. how can be this done. if i wish to added controls in cache

View 17 Replies

Control Not Redrawn On Me.Invalidate()

Apr 13, 2012

I call Me.Invalidate() in the property setter of a custom control (inherits from ProgressBar) but it only causes the control to paint on screen about 1 in every 10 times (or less) whereas there are far more times that the code enters the painting routines (i.e. only on some occassions do the painting routines cause on screen changes). I am using my own Painting routines, not using ProgressBarRenderer.

On the Inherited ProgressBar I set Minimum to 0 and Maximum to 1000 and use a timer to increment Value by 1 on each tick (100ms). Therefore Me.Invalidate() should be called after every tick and hence the 'progress' of the bar should be quite smooth - 1000 small increments as it fills the bar should be pretty small changes and hence appear fairly smooth.

However, what happens is that the control only changes on screen about 1 in 10 of the times that Value changes. The control also writes the progress as a % (integer) onto its surface and each change in the % text is accompanied by an increase in the visual progress. I think this apparent synchronisation is coincidence though, since using Console.WriteLine I can see many many calls to the Painting routine but a few of them actually cause a visual change on screen.

I have tried slowing the timer down to 1000ms but this hasn't changed anything other than there are far more than 10 calls to the painting routines between actual on screen changes.

I am using PointF, RectangleF and SizeF to avoid 'rounding errors' and hence blocky progress from using the Integer versions of those structures.

There's some stuff from the Output window (using Console.Writeline) near the bottom of this post that shows that at the beginning there is 1 OnPaint per Invalidate. Later on (somewhere around 1% and 5% progress) it changes to having several OnPaint calls between Invalidates. So I certainly don't appear to be short on calls to OnPaint. I only appear to be short of actual OnScreen changes.

The Painting routines use the RectangleF structures to create GraphicsPath objects, which are used to create a Region that is then filled by e.Graphics.FillRegion.

Possibilities I can think of:

1) The painting events are too frequent to allow screen udpating, but this doesn't seem likely since 1000ms timer ticks didn't help

2) GraphicsPath and / or Region objects aren't 'precise' and hence a range of similarly sized RectangleF objects create essentially identical GraphicsPath objects (or the same problem when moving from GraphicsPath to Region)

3) Erm, not sure...

Here's the Setter code:

Public Shadows Property Value As Integer
Get
Value = MyBase.Value

[Code].....

View 3 Replies

Generate A PaintEvent Without Calling An InValidate?

Apr 29, 2009

I am creating an application that is drawing different types of lines in a Panel called Panel1 and realized that everytime I call Panel1.Invalidate() alll the lines that are currently drawn on the display during runtime are cleared then redrawn every time.Is there anyway to generate a PaintEvent without calling an InValidate?

View 2 Replies

C# - Preferred Techniques For Passing Objects Which Clients May Invalidate

Jan 31, 2012

I have adopted a technique where I pass existing objects to forms so that they can display the object's content and allow the user to alter it if necessary. The form is not bound to the object, so when it comes time to act, the form sweeps up the content of its controls and puts them into the object. The object is then validated and any issues reported to the user. If the object is valid, it may be handed back to the caller so the caller can refresh a view/list/etc.

So far, so good. However, if the form's content, or lack of, creates an invalid object and the user does not correct it, maybe cancelling the form, there's a chance the form will hand an invalid object back to the caller. This is not good.

Essentially I'm looking for an elegant and efficient way of either leaving the object as it was or rolling back if the user cancels the form/action.

I have considered a range of techniques, each with many pros and cons. I'm keen to consider some other views.

View 3 Replies

Checkbox Only Check Single Item From List?

May 16, 2011

My form contains a combobox which contains several usernames which are bound to my database.I've added a checkbox to the form which will be used to select the default username from the list.

View 8 Replies

Color A Single Item In A Windows Datagrid?

Feb 4, 2010

How can you color a single item in a windows datagrid (Windows datagrid 2.0 for Visual Studio 2005)? I tried the overrides paint function but it is very memory intensive for it hits the function each time you move from one cell to another.

View 3 Replies

Forms :: Adding A Single Item To A Combobox?

Apr 4, 2011

I'm new to vb.net and I have what probably is a simple question, but one that I am stuck on. I'm trying to add a single item to a ca combo box at run time. For example, a user selects a category from the first drop down box at run time, say "Admin", I want to add a single item to the combo box below it: Not applicable.

cboTest.Items.Clear()
cboTest.Items.Add("Not Applicable")

View 1 Replies

Single Item To Be Displayed In Crystal Report?

Mar 15, 2012

I have 3 columns in my database (book title, book author, date added). for example Karen Harper has 5 books in my database and Lisa Jackson has 3. I will enter the date added in a textbox (for example 01-15-2011 since all was added on that date) and once I click "show book author's name" my crystal report will display Karen Harper 5 times and Lisa Jackson displays 3.

View 2 Replies

Linq - Select Single Item From Child Collection?

Jan 12, 2012

I have a parent child collection objects and was wondering how to get a single item from the child collection using Linq

[Code]...

View 2 Replies

Add One Single Item In Combobox After Populating It Form Database Table

Sep 7, 2009

i have imported names from database table into combobox..i want to add item"all" above all names..how can i just add one single item in combobox after populating it form database tabel.

View 1 Replies

Set Folder Options Single Or Double Click To Open Item?

Nov 4, 2010

I would like to be able to set the following settings in the folder options:

- single click to open an item
- double click to open an item

I am using Visual basic 2008 Express edition.

View 2 Replies

Single Click On Notifyicon Menu Item Produces Two Events?

Dec 17, 2009

I have a program which puts an icon in the notification area and has a menu associated with it available by right clicking on the icon. I want the menu items to be selected by single left clicks but I also want the user to be able to single left click on the icon itself to do some other functionality.

Here's the problem - the single click on the menu first fires the notifyicon1_click() routine and then the menuitem1_click() routine. How do I know in the notifyicon1_click() whether it has been called from a menu click or a click on the icon itself?

the following piece of test code duplicates the problem

Imports System
Imports System.Drawing
Imports System.Windows.Forms

[Code]....

View 8 Replies

Forms :: Write A Program For A List Box Having 10 Items In That Just By A Single Click On One Of The Item?

Dec 6, 2011

how to write a program for a list box having 10 items in that just by a single click on one of the item it should be written on the button if a list is containing notepad than by clicking on the button it should open the notepad?

View 2 Replies

Variables - Combining Multiple Data Types Into A Single Unified Data Structure

Mar 16, 2012

In VB.NET I would like to create a complicated data structure with multiple types of data stored in an array like format (see below). I am trying to create a data structure that would look something like this: [Name; xLoc; yLoc; zLoc; [Jagged Array]] Note: Name needs to be dimensioned as a string, xLoc and so forth as integers. The Jagged Array would look like this:

[Code]...

View 1 Replies

Single Line Data Entry From 3 Dimensional Data?

Sep 21, 2011

Basically, our users enter values onto a spreadsheet and I have been asked make the spreadsheet output to a CSV file preferably each one completed appears as a single line in the CSV.Upon examining the spreadsheet, I cannot figure out the best way of acheiving this, or if it is easily acheivable in the first place.I have attached an example of the spreadsheet data, to give it some context the spreadsheet records times that carers have visited a client, which can happen many times a day over many days per week, there is also a yes/no for each day on the sleepin.

View 5 Replies

Reciept Printing - Form Which Consist - Item Code , Item Name , Item Price , Quantity Of Item

May 25, 2012

Regarding my college project. i'm working on a sales system . i have a form which consist of all the following information( item code , item name , item price , quantity of item ) which is display using a data grid . data input by user using text box and all this information will be stored in a database(sales database) i'm using ms access 2007. the grand total will be displayed in a text box . and amount paid will be input in a text box too , my major problem now is how to i create a reciept that will have all this information of the purcase. i have a reciept button . what the next step ? i dont have any idea how to get the reciept done.

Imports System.Data.OleDb

Public Class Form5
Dim con As New OleDbConnection

[CODE].......................

View 9 Replies

VS 2008 Listbox Control - Add Array Of Object As A Single Item In Listbox?

May 26, 2011

problem that i am facing is i want to add array of object as a single item in listbox. in vb6 i was using this Label1.Caption = Label1.Caption & Mid$ (strInput, intI, 1) & " " List1.AddItem (Label1.Caption) i was using label. caption to store object but not work in vs2008 because label.text only take text and left other values

View 18 Replies

Single Data Type ?

Jun 22, 2009

I have a single data type, and when debugging, I found the value of this data type is -1.#IND

What is that -1.#IND?

View 2 Replies

Copying Data From One Table To Another Using A Single Combobox?

Apr 30, 2012

I'm writing an app to print a list of beers that are currently on tap at the restaurant where I work part-time. We have 29 taps and dozens of different beers. I have 2 tables in a database (one with the "master list" of all the beers and an "on tap" one with one entry per tap). Each database entry includes fields for name, brewer, location, style and ABV. So far I've made a GUI with 29 combo boxes (one for each tap) and 2 buttons (one that opens a dialog box to modify the "master list" and one to print the list). The idea was to make it as simple as possible since the people who use it aren't great with computers and are often in a hurry.

Each combo box drops down the whole master list of beers and I'd like for the selected beer to be written to the corresponding index in the "on tap" table. My idea is to then extract the data from the "on tap" table and print it. I haven't done any coding yet, really, just drag-and-drop.It's frustrating since I know how I'd do the back end in C or C++, but not in VB. The reverse is true for the GUI.

View 2 Replies

Multiple Data Items In Single Field?

Apr 30, 2009

What I'm trying to do - VB 2005 express and sql 2005 express editions - Trying to set up just a basic hardware/software inventory program. As is I've got separate tables for computer and software licenses...with ComputerID and LicenseID primary keys respectively...where I'm bumping into walls is that I wanted to be able to link them together with a foreign key, for example the computer record would have a foreign key for LicenseID and when a license would get installed the ID would go in and there'd be a nice pretty link. However I run into scenarios where a computer might not have any software installed...or might have more than 1 software item. Or a single software item may be installed on 1 computer, multiple computers, or nowhere. It possible to have that single foreign key field link to multiple records from the opposite table?

What was originally suggested to me was to have a 3rd table called Installations. It'd have 3 rows...one named InstallationID as the primary key, and 2 foreign key rows named ComputerID and LicenseID that linked to the other tables, so that when a license was installed, a record would be added to the Installations table, and later on when we wanted to see where all a particular license was installed or what licenses a single computer had, the table could be filtered by computer ID or license ID and all matching records could be displayed. When I tried that out though I'm having a heck of a time getting the correct items to display.

Just as a basic test i set up a new form and dragged the tables onto it from the Data Sources window using "Details" view for each of them, so that it set up the table adapters and binding sources and navigator for me. I got rid of the auto-added labels + textboxes on the form and added just a couple new textboxes, 1 linked to the licenseID and one to another row i had in that table for productkey...tested it and it moves through the records fine and the correct data shows up in each box to correspond with the other. now though I'd like to add another control to display each of the ComputerIDs that are linked to the particular license being displayed in the other controls via the foreign keys routing through the Installations table, but I'm not having much luck.

View 1 Replies

Multiple Data Source For A Single Report?

Jun 9, 2011

is it possible to have a single report from two different tables? Because I have been reading articles that are saying that it is not possible and a subreport should be implemented? Can anyone clarify this for me?

I've been retrieving the fields that I need for my report with inner join sql statement and setting it as the data source of the report that I had created but it doesn't show up when the crystal report viewer is loaded. I had the correct syntax based on testing on what is retrieved by the statement, the only problem is how should it be shown in a single report.

View 3 Replies

Print A Single Report From 3 Data Table?

Aug 3, 2009

I have created 4 table and data set. I would like to print information from 3 table on a single report. I already created a rdl. report form.

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved