vb.net

Private Shared Variables vs Local Variables / Namespace Pollution vs Performance?

Reviewing code, I came across a number of new Private Shared variables (of type Hashtables(Of String), initialized in the declaration) added to a partial class for a very large (DataContext-derived) class. This seems sensible to me in one sense because they never change, and making these shared variables ensures that they won't get re-i...

best vb.net book for vb programmer

I want to learn VB.NET. I am an experienced programmer in C, C++ and Java. I know VB 6.0. Which would be best book for me from below? I made few choices: Professional Visual Basic® 2008 by Bill Evjen, Billy Hollis, Bill Sheldon and Kent Sharkey Mastering Visual Basic 2008. u can also suggest any other better book. ...

What is the best way for my application to get user input in VB.NET?

My winforms application will display 100 different names, and I will need the user to enter a number 1 through 4 next to each name. I will then store this data. I know I can use the spreadsheet control, but is there something much simpler that I can use? Maybe an array of textboxes or a datagrid? ...

how do i print my form?

i need to print my vb.net windows form when the user click a button. what is the method for this? ...

Is there a way to use a Dictionary-like collection as an Application Settings object?

I'd like to store a set of key/value pairs in the application settings of my ASP.NET web app, but I'm not finding a straightforward way to do that. For example, these two questions tell me that StringDictionary etc. won't serialize to XML and suggest that I'll have to roll my own implementation. But it seems like this should be easier ...

How can I close the application when any form is closed?

I have multiple forms in my VB.NET application. How do I make it so that any form I close will terminate the application? ...

Adding empty string to RadComboBox

Guys, I have a webpage that has a Telerik RadComboBox on the page. One of the properties of this ComboBox is EmptyMessage, which fills the combobox with a message when an item is not selected. I am binding my combobox to a datasource at runtime and for some reason, it wipes this EmptyMessage away. Is there a way to keep my data items in...

Master pages -- Getting calling page name

Can someone tell me how to get the name of the child page being called in a Master page scenario. For example, if I have the following masterpage: <%@ Master Language="VB" CodeFile="MasterPage.master.vb" Inherits="MasterPage" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-trans...

resizing array at runtime in vb.net

on my winform at runtime i will be resizing my array each time i add an element. so first i must resize to the size + 1, and then add a member to this index. how do i do this? ...

Finding equality in items in two lists of differing types

I have two objects that are derived from same the base class. Lets say ObjA is the base class, and ClassB and ClassC inherits ObjA. If I have a dim lst1 as List(Of ClassB) dim list2 as List(Of ClassA) and and I want to check for the existence of something being in lst1 that it is in list2, now I am only interested in comparing ...

How do I write private set auto-properties in VB 10?

in C#: public string Property { get; private set; } in VB? Please vote or/and share your ideas! ...

VB.NET in Visual Studio 2008 on Vista 32bit building a WSP

I am trying to build a WSP file in VS2008 on my VB.NET project. How would I go about doing this? I can find a lot of plugins for C# but not VB.NET. ...

IndexOutOfRangeException in VB.NET

...

How check bitArray contains any true or any false value ?

In C# and Vb.net,is any way without iterating by loop a bitarray to check contins any true or false value (Dotnet 2.0) ? ...

Where to find base type of a class

One thing that always bugged me, is that I do not see the base type in Visual Studio. I just stumbled on this, because I tried to cast a System.Windows.Forms.MenuItem to a System.Windows.Forms.Control In eclipse the "intellisense" (or whatever it is called) shows me while exploring the members of a class for each member from which base ...

converting a string to a constant string

I have the following code... Const ToAddress As String = username.Text & "@gmail.com" which sets to ToAddress to be used in on my Net.Mail.MailMessage that is to be created with the following constructor Dim mm As New Net.Mail.MailMessage(username.Text, ToAddress) which takes in a string and a constant string. But I get an error her...

Best practice for adding controls at run-time

When adding controls to a form at runtime, you can do either of the following: Button btn = new Button(); //... this.Controls.Add(btn); or Button x = new Button(); //... btn.Parent = this; I had assumed that they were the same, and it was just down to personal preference which way to do it, but someone at work mentioned that the se...

How to use System.Dynamic.DynamicObject in VB.NET 10.0 ?

How to use System.Dynamic.DynamicObject in VB.NET 10.0 ? I can create class that inherits from DynamicObject, but cannot actually use it. ...

How can I populate a dropdown list with data?

I have a dropdownlist that I want to populate with a specific value and specific text. I'm not using a datasource but I am manually making a connection and retrieving data in code. How can I populate this dropdownlist? If I read the data with a datareader and increment an array I only get either the value or the text. This is what I have...

how to insert,delete and update data in database using ado.net in Vb.net (database MS access)?

Imports System.Data Imports System.IO Imports personal_dtls.perds Imports personal_dtls.perdsTableAdapters Private Sub insert_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles insert.Click Dim adapter As New perdsTableAdapters.Daily_AttndTableAdapter adapter.InsertQuery("as", "asd", "...