vb.net

Keeping tables cached on server in ASP.NET project

I have an ASP.NET project which is a front-end to a database. In addition to the large tables, the DB contains a few small tables to help normalize the larger tables with common values. I have a VB.NET project which loads the smaller tables into memory, using "Shared" (i.e., "static" in C#) member variables, and uses them. I have a ca...

Converting Code Snippet from C# to VB.NET

All the automated, online converters weren't able to convert this code. Unfortunately my brief knowledge of C# has also let me down. The code originates from a blog, linked from another of my questions. Here is the code snippet in C#; var virtualFileDataObject = new VirtualFileDataObject(); virtualFileDataObject.SetData...

VB Byval I don't need it.

I don't need this declaration because it only makes my code big and unreadable. Is there a way to make Visual Studio (VS) not add it automatically. Every time I remove it, it is added back by VS. Function DoStuff(Tom As String) NOT Function DoStuff(ByVal Tom As String) ...

VB.NET dynamic use of form controls

I have 10 labels named lbl1, lbl2, ... lbl10 I'd like to change their propriety (using a cicle) with the cicle index for i as integer=1 to 10 step 1 lbl (i) = PROPRETY 'I know this is wrong but it's what I would do... end for I'm using a workaround, but I'm looking for a better way.. Dim exm(10) As Label exm(1)=lbl1 ...

Automatically print out orders

Hi guys, I am wanting to create a VB.Net app that checks a database and then prints out the latest orders, the database is mysql and i need it to periodatically check and only print new orders i.e. not print ones it has already printed out. Any advice would be greatly appriciated. Kyle ...

Create a new instance of a type given as parameter

Hi, I've searched for an answer and found some c#-examples, but could not get this running in vb.net: I thought of something like the following: public function f(ByVal t as System.Type) dim obj as t dim a(2) as t obj = new t obj.someProperty = 1 a(0) = obj obj = new t obj.someProperty = 2 a(1) = obj return a End ...

Unable to store the value of Unbound Column from Grid Properly (DevXpress 6.2) ?

Even though im using CustomUnboundColumnData Event, im unable to store the value of Radio selection properly. My Grid Has 3 Columns SelectColumn, Value1, Value2 where SelectColumn contains the RadioGroup.I would like to retain the value of the selected Radio, because the selection disappears if i click a button or move to another tab. ...

Create a dynamic control and AddHandle WITH Values/Brackets

Hi, it seems that adding for example a button Dim myButton as New Button and then addHandler to mySub("lol", 255) is not possible. Where mySub is Shared Sub MySub(byRef myString as string, myInteger as Integer) So: addHandler myButton.click, addressOf mySub("lol", 255) - returns an error saying it does not work with parentheses or what...

How can I sort just part of a huge list using .NET?

In .NET, the Generics Lists have a sort function that accepts IComparer or Comparison. I'd like to sort just part of a list. Hopefully I can specify the start index, count of elements to sort, and a lambda function. It looks like you can only use lambda functions to do this if you're sorting the entire list. Is that right or did I mi...

Is it possible to convert Gregorian to Hijri date in Vb ?

Hi, I have a table in sql where the date format is stored in Hijri. Now I am working on a vb.net application where I have to let the user update that dateField. So is it possible that if I place a datepicker(which is in Gregorian) and user selects the date and its converts into Hijri date before updating. I mean when the user selects t...

Export Visio Macros to Visio COM-Add-in

Hi all, I have written some Makros and Functions in VB all code works fine behind my Document. To save my code and make it available to other users I want to create a COM-add-in for VIsio. So i bought Visual Studio 2008 and I want to import my code to it. Is it possible to include my exported .cls file to my Visual Studio COM-Add-on Pr...

ASP.NET Setting Culture with InitializeCulture

I have a website with three domains .com, .de and .it Each domain needs to default to the local language/culture of the country. I have created a base page and added an InitializeCulture Protected Overrides Sub InitializeCulture() Dim url As System.Uri = Request.Url Dim hostname As String = url.Host.ToString() Dim Selec...

which is the best tool to create vb.net skins ?

In my company we are planning to develop a GUI for an existing vb.net application which is the best tool to create vb.net skins ? ...

Print ms access data in vb.net

How do I print the ms access data(.mdb) in vb.net? Here is the code that I'm using to view the data in the form. What I want to do is to be able to print what is currently being viewed. Perhaps automatically save the .pdf file and the pdf viewer installed on the system will open that newly generated pdf file Dim cn As New OleDbConnecti...

Transparent ListBox or Listbox...

Hi all I want set Listbox background to transparent but not working Is there any idea? ...

VB.NET Custom Object Master-Detail Data Binding

Since beginning to use VB.NET some years ago I have become slowly familiar with using the data binding features of .NET, however I often find my self bewildered by it's behavior and instead of discover the correct way it should work I find some dirty work around to suit my needs and continue on. Needless to say my problems continue to a...

Generic Lists copying references rather than creating a copiedList

I was developing a small function when trying to run an enumerator across a list and then carry out some action. (Below is an idea of what I was trying to do. When trying to remove I got a "Collection cannot be modified" which after I had actually woken up I realised that tempList must have just been assigned myLists reference rather t...

Items are being replace by another in the Datagridview

When I add the first item in the datagridview its ok but when i add the second one it replace the last item being added. here's my code Private Sub add() Dim i As Integer For i = 0 To DataGridView1.Rows.Count - 1 'DataGridView1.Rows.Add() DataGridView1.Rows(DataGridView1.RowCount - 1).Cells("TransID").Value = txt...

How do I write to a command prompt that is already open?

I need to write one line at a time (user iterative process) to a command prompt that is already open. I'd like to use VB or VBA. I know there is AppActivate, but then how do you write to it? The command prompt is run by another program (that I can't touch). Suggestions? ...

Isolating read and write in multithreaded

Hi In a multithreaded application. I have a bunch of function that loop through a collection to read the information. I also have a bunch of function that modifies that same collection. I’m looking for a way to isolate all the read and the write together. I don’t want a write to be done while a read is in progress. I was thinking of us...