vb.net

Using .Split to remove empty entries

I am trying to split at every space " ", but it will not let me remove empty entries and then find the length, but it is treated as a syntax error. My code: TextBox1.Text.Split(" ", StringSplitOptions.RemoveEmptyEntries).Length What am I doing wrong? ...

Is there any Visual Basic 2008 scrolling text code?

I want a code that when applied to text in Visual Basic 2008 it scrolls across the screen. I don't want anything flashy, just something basic to start off with. If you guys know of such a thing that would be great! EDIT: I would like it to cycle, hope this makes it easier! ...

How to write Dynamic VB.net code?

For example i got a class and its got its own properties and i am passing the name of the class and the name of the property to be called to a function Say for example exp is the variable which i am passing which contains a value = "ClassA,Property1" Function Property2BCalled(byval exp as String) dim classname ...

How can I add an item to IEnumerable(Of T) in VB.NET?

I see a couple of previously answered questions about adding an item to an IEnumerable in C#, but I'm stuck when trying to implement the proposed solution in VB.NET. Option Strict On Dim customers as IEnumerable(Of Customer) ' Return customers from a LINQ query (not shown) customers = customers.Concat(New Customer with {.Name = "John Sm...

clear the pictureboximage

how can i clear the image in a picturebox to draw a new image. ...

VB.Net how does one call a function name retrieved from a table?

In VB.Net how does one call a Parameterised function name retrieved from a table? My Parameterised Function Name is below procTextToDBTemp(Application.StartupPath & "\" & strFileName) from above function i Stored procTextToDBTemp into the SQL Table How can call that function in the Vb.net How can i do that Please help me Thanx in ...

Best way to establish a connection for use with an ADO.NET command object

I'm designing a web service in ASP.NET and VS2008, and am using typed datasets for retrieving table data. These work well and establish their own connections through their associated TableAdapter objects. Edit: I'm using VB, BTW! I am now attempting to run a custom SQL string using a DataAdapter and a Command object, however I need to r...

Cannot start a windows service developed in vb.net

Well, it works on my own computer where I have visual studio installed. I install the exe file with installutil and the service works fine. But when I install it on another computer where only the framework is present, I still can install it with installutil BUT I can't start it. I get something along this Could not start the Search serv...

How to maintain paging on page load

Hi, I am using vb.net code in which I am having a gridview control. Please see the below code <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" CssClass="innerGridTable" DataKeyNames="OrgID" DataSourceID="OrgGridViewDataSource"> <Columns> <asp:CommandField ShowSe...

VB.NET: identifier for TAB?

What identifier should I use for TAB (e.g. for output to text files)? There are many choices: vbTab ControlChars.Tab A constant (or public member) in my application set to Chr(9) What is best practice? And why? ...

Getting referral link with asp.NET

How am i supposed to know from which webpage the user came into my website. Is there any way of reading such info with asp.NET? I would like to store that info (referral link) into a cookie for later processing. ...

Reflection - Iterate object's properties recursively within my own assemblies (Vb.Net/3.5)

Hi, I wonder if anyone can help me - I've not done much with reflection but understand the basic principles. What I'm trying to do: I'm in the process of developing a class that gathers a lot of information about the local system, network, etc... to be used for automated bug reporting. Instead of having to change my test harness every...

What's the easiest way to get just the top-level text of an XmlElement?

Suppose I have some XmlElement; let's call it element. If I want to get all of the child nodes of that element, I can call element.ChildNodes. If I want the text of the element and all its children, then I can go with element.InnerText. However, suppose I have some XML that looks like this: <TopElement attr1="value1" attr2="value2"> ...

SQL Server 'Resume Next' Equivalent

I'm working on a project in VB.net which takes large text files containing T-SQL and executes them against a local SQL database, but I've hit a problem in regards to error handling. I'm using the following technologies : VB.net Framework 3.5 SQL Express 2005 The SQL I'm trying to execute is mostly straight-forwards but my app is co...

How does the .net framework nest forms in classes. (vb.net).

If I look at some classes in the framework, using reflector, I can see that forms and user controls are made private and nested into a parent class. For instance, I have a control which makes use of pop-up form that is specific to that control. At the moment, I make the pop-up form friend accessible. If I wanted to do it the framework w...

Equivalent of WinForms TextBox.Validating event in WPF

In WinForms I could handle the Validated event to do something after the user changed text in a TextBox. Unlike TextChanged, Validated didn't fire for every character change; it only fired when the user was done. Is there anything in WPF I can use to get the same result, an event raised only after the user is done changing the text? ...

How to get the type for a class by sending just the name of the class instead of the class itself as the parameter?

Dim a as Type=GetType(className) would gimme the type. But I have only the name of the class as string. I want something like GetType("class1") which would return the type. ...

Do "heavy" properties carry weight, even if they are not populated?

Let's say you havew a user class. When the user is logged in there are properties representing basic user info, an associated address and, say, 5 profile pictures, the last a generic lsit like this: Private _photos As List(Of Photo). However, instead of carrying the weight of the profile pictures in a session vairable, to reduce resource...

Difference between C# and VB.NET for default values of private members

In C# I have the following code: a base class with a virtual InitClass() function a child class which overrides the InitClass() function. In this function I set a private variable a public property exposing my private field namespace InheritenceTest { class Program { static void Main(string[] args) { ...

How are value type properties in a refernce type class allocated?

In VB.NET, if I create a class it is a reference-type. But, if that class it chock full of value type properties, how is this handled? If the class is instantied but never filled, I suspect a pointed for to the heap is allocated. But is more space allocated on the stack for all of it's value type properties? ...