vb.net

Opening an application inside a form - C# or VB.NET

I am writing an application and I would like to be able to display another application inside it. (Think like a windows form with a small box, or a tab that is displaying a totally seperate application.) Is that something that can be done? If so, can anyone give some direction on how to go about doing it? I am looking for something i...

Does the Helper Module have to be in AppCode for MVC to recognize when using VB.net

When I have my Helpers in the AppCode Directory of my APS.NET MVC VB Application I can type <%=HTML.ImageUrl("myImage.gif")%> If I move it to another folder I get Errors. I assume I can import the Application Namespace to get it to work but is that Necessary? ...

Iterate through generic list of unknown type at runtime (VB.Net)

Does anyone know how to iterate over a generic list if the type of that list isn't known until runtime? For example, assume obj1 is passed into a function as an Object: Dim t As Type = obj1.GetType If t.IsGenericType Then Dim typeParameters() As Type = t.GetGenericArguments() Dim typeParam As Type = typeParamete...

VB date conversion

Is there an easy way to convert a string that contains this: Date: Wed, 5 Nov 2008 13:12:12 -0500 (EST) into a string that contains this: 20081105_131212 UPDATE: I ended up using date.tryparse which is similar to tryParseExact except you don't have to specify the format string. I did have to eliminate the () and the EST for this t...

Calculating Months

I have an application where the user selects the dates of a first statement and a last statement. Example, first statement = 1/1/08, last statement = 12/1/08, should equal 12 statements. However, when using the following code, the result is 11: numPayments = DateDiff(DateInterval.Month, CDate(.FeeStartDate), CDate(.FeeEndDate)) Is th...

XML to Database in ASP.NET

Using VB.NET, how do I add the values from an XML file into an SQL Server database with a similar schema? ...

Return a value from a insert statement.

Working with an Oracle 9i database from an ASP.NET 2.0 (VB) application using OLEDB. Is there a way to have an insert statement return a value? I have a sequence set up to number entries as they go into the database, but I need that value to come back after the insert so I can do some manipulation to the set I just entered in the code-...

Passing values with Parallel Extensions and VB.net

I am looking for an example of how to do the following in VB.net with Parallel Extensions. Dim T As Thread = New Thread(AddressOf functiontodowork) T1.Start(InputValueforWork) Where I'm getting stuck is on how to pass into the task my parameter InputValueforWork Dim T As Tasks.Task = Tasks.Task.Create(AddressOf functiontodowork) An...

Rename nodes with XSLT

I am trying something very simple, but for some reason it does not work. Basically, I need to rename some nodes in an XML document. Thus, I created an XSLT file to do the transformation. Here is an example of the XML: EDIT: Addresses and Address elements occur at many levels. This is what caused me to have to try and apply an XSLT. The...

Ideas for how to deal with viewstate when using ASP.NET AJAX and update panels

Here is a class that I wrote to solve some issues that I was having with viewstate. It stores the info in the users session and increments a value to track which state to show. The difficulty is that there is no support for the back button. The reason I originally had this was that before AJAX came along the viewstate was being send d...

Automatic casting to string in C# and VB.NET

I could do this in C#.. int number = 2; string str = "Hello " + number + " world"; ..and str ends up as "Hello 2 world". In VB.NET i could do this.. Dim number As Integer = 2 Dim str As String = "Hello " + number + " world" ..but I get an InvalidCastException "Conversion from string "Hello " to type 'Double' is not valid." I am a...

VB.NET - How do I assign an object to an object instance (better description inside)

I have an object instance which I access with the ME as it accesses the instantiated object. I have a method that gets a collection of these objects and I wish to assign the first one to the instantiated object. This is some of the code Dim Books As New BookCollection(True) Books.ListByThemeFeatured(ThemeID, 1) ' Fills the collection ...

C# Float vs. VB.net Single - Namin' complainin'

Why is it called a single in VB.net? I'm sure there is a good reason but it doesn't seem intuitive to a non formally trained programmer like me. ...

Does authentication/authorization stop Jquery from calling a page method?

Hi, I have the following JQuery code that worked perfect in C#/Asp.net 2.0 to call a page method in the default.aspx page. Now I am trying to call a shared page method in VB.Net and the page method is not firing, I believe because of security or it is not finding it. The page that this shared vb method is in doesn't allow anonymous ac...

ADO.NET record navigation

I've done development in both VB6 and VB.NET, and I've used ADODB objects in VB6 to handle recordset navigation (i.e. the MoveFirst, MoveNext, etc. methods), and I have used ADO.NET to handle queries in a row-by-row nature (i.e For Each Row In Table.Rows ...) But now I seem to have come to a dilemma. I am now building a program in VB.N...

How to suppress compiler warning for specific function in VS2005 (VB.Net)

I have a class that inherits from a base class and implements the following... Public Function CompareTo(ByVal obj As Object) As Integer Implements System.IComparable.CompareTo Now the base class it inherits from also implements this System.IComparable.CompareTo so I'm getting the following compiler warning: Warning: 'System.ICom...

I need a quick and dirty way to append to a text file in vb.net

I've got a very small standalone vb.net app that gets run automatically. Every now and then it hits an error condition that I want to log and then keep processing. But, this is far too minor a thing to store in the system's main log - I really just want to append a line to a text file. What's the least stress way to append a line of t...

Force multi-threaded VB.NET class to display results on a single form

I have a windows form application that uses a Shared class to house all of the common objects for the application. The settings class has a collection of objects that do things periodically, and then there's something of interest, they need to alert the main form and have it update. I'm currently doing this through Events on the objects...

Execute a SSIS package FROM VB.NET or C#

I have a SSIS package that eventually I would like to pass parameters too, these parameters will come from a .NET application (VB or C#) so I was curious if anyone knows of how to do this, or better yet a website with helpful hints on how to do it. So basically I want to execute a SSIS package from .NET passing the SSIS package parameter...

Type parameters cannot be used as qualifiers

VB.Net2005 Simplified Code: MustInherit Class InnerBase(Of Inheritor) End Class MustInherit Class OuterBase(Of Inheritor) Class Inner Inherits InnerBase(Of Inner) End Class End Class Class ChildClass Inherits OuterBase(Of ChildClass) End Class Class ChildClassTwo Inherits OuterBase(Of ChildClassTwo) End Clas...