vb.net

VB.NET XML Parser - Find elements with specific attribute & value

HI, I am using VB.NET to read an XHTML file. I need my program to find every element within the XML structure which has the "class" attribute set to a specific value. IE: I need an array (or similar list) of all elements from the document which contain class="mytag". There is a list of several values I need to detect, all of which sta...

Validator or Expression in VB.net to check if the value entered in that textbox.

Hi, I am using vb.net. I am having below code in vb.net <tr> <td > DateOfReceiving: </td> <td> <asp:TextBox ID="DateOfReceivingTextBox" runat="server" CssClass="datepicker" Text='<%# Bind("DateOfReceiving","{0:dd/MM/yyyy}") %>' /> </td> <td > TokenStartingNumber: </td> <td> <asp:TextBox ID="...

code snippets in vb.net

In desktop development how to drag the image and drop that image at the desires location in the form/panel for 'n' number of times. Here i worked with the following code but i cant found solution Public Class Form1 Dim m_MouseIsDown As Boolean = False Private Sub picturebox1_mosedown(ByVal sender As System.Object, ByVal e As Syste...

PV Function and Porting VB6 to C#

I'm working on porting some classic VB6 code to C# and just stumbled across a usage of the PV function. I feels wrong including a reference to the Microsoft.VisualBasic Assembly. Is this something that is commonly done, or should I explore further options. The next idea that pops into my mind is exploring this PV function in Reflector. ...

DataPager ceases to work when PageSize is set in code

Hi, I have a standard ASP.Net DataPager with a standard ListView (using a DataTable as a data source). When I set PageSize="24" in the design code: <asp:DataPager runat="server" ID="DataPager1" PagedControlID="ListView1" QueryStringField="page" PageSize="24" > the paging works as advertised. However, when I then change that in code...

detecting if type implements ICollection<T>

Hello, I am trying to check if a type implements the generic Icollection interface, since this is a base interface for any of my generic collections. the below code doesnt work GetType(ICollection(Of)).IsAssignableFrom( objValue.GetType().GetGenericTypeDefinition()) whats a good way of detecting if a type implements a generic in...

How to test which tab is selected in VB.net TabControl

Hi, I have a TabControl with two TabPages and I was wondering what is the best way to test which tab is currently displayed? I'm not sure why I can't figure this one out... ...

Get iis web directory path in VB.net outside a web project

I need a method to know iis current wwwroot in VB.Net. I need to get this information outside a web project (otherwise the problem would have a simple solution). I think I need to read this information from the registry, but I have no idea where to start looking. Thank you ...

Crystal Reports class conflict in namespace

I have recently created a new crystal report. Things were fine, report looked good, I was previewing it fine, I could run my project and things looked great. I then made a minor formatting change (made the details section slightly larger and added a line across the top) I then previewed the report and noticed that it created a second co...

Is there a library out there to analyze VB.Net code complexity from my C# code?

Given VB.Net code in a string, is there a library (or a command line tool) out there that could calculate Cyclomatic Complextiy and LOC? This has to be done within my C# code. Thanks. ...

Application design advice

I’m looking for some advice for an application I currently developing. I’ll try to keep this as brief as possible so if additional info is need just let me know. I’m developing an Winforms based event tracking system using VB.Net (VS 2008 Pro). The application collects data via serial bar code scanners and stores this data within a MS...

How to access a C# internal property from VB.NET project in same solution?

My Visual Studio 2008 solution contains both C# and VB.NET projects. From a VB.NET project, how can I access a C# property with its access modifier set to "internal"? ...

.Net System.OutOfMemoryException filling a datatable

I need to extract data from a .dbf file and transform it into xml. I wrote a routine that does it just fine. However now we are encountering very large .dbf files - like 2GB +. And this code throws an OutOfMemoryException on those files. Public Function GetData() As DataTable Dim dt As New DataTable(Name) Dim sqlcommand As St...

Showing Images in gridview as block items

I want to show items in my gridview as a 5 across and a 5 down display - i already have the query pulling only 25 records per a page but cant seem to make the gridview do what i want - any suggestions? example------------------------------ record 1 : record 2 : record 3 : record 4 : record 5 record 6 : rec...

TripleDES Encryption - .NET and ColdFusion not playing nice

I'm trying to exchange encrypted data between my ASP.NET application and another developer's CF app using TripleDES. Here's his CF code (fictitious key and IV of course): <cfset variables.theKey = "rpaSPvIvVLlrcmtzPU9/c67Gkj7yL1S5"> <cfset variables.theIV = BinaryDecode("password","Base64")> <cfset variables.theAlgorithm = "DESEDE"> <...

How to stop inserting records in SQL table when a limit is reached

Hi, I am using VB.net and SQL Server 2005. My Problem is that I want to give user a message if the delegate limit has reached for that course. See I have a course where I have MinDelegate and MaxDelegate limit. I want to stop inserting and give user message that "Max Delegate limit has reached can't have more delegates for this course...

Trim String by so many characters but do not cut off last word.

Hi, I have a large text field taken from a database rs.Item("content") How can I limit this to say 100 characters but not cut off the last word. eg "limit this to 100 cha..." Id like to add the... onto the end also. Thanks ...

Stop FTP file downloading

Hi all, This is my sample code run under thread to download file from ftp server. In that, if the user want to stop file download, i tried to abort the thread. If the control in the while loop, its hang up. How to close the binaryreader and Stream, when reader in the middle of stream Using response As FtpWebResponse =...

VB.Net - multi-column data variable object

Hi, I want to create an in-memory object in VB.Net with multiple columns. What I am trying to do is create an index of some data. It will look like: Row 1: 23 1 Row 2: 5 1 Row 3: 3 38 ... I know I can use a rectangular array to do this, but I want to be able to use indexOf opearations on this object. Is there any such structure in VB...

Returning a inherited class as base class type with Web Services

I suspect I am being very silly here but I have the following setup Class MustInherit myBaseClass 'some stuff End Class Class myInheritedClassA inherits myBaseClass 'some more stuff End Class Class myInheritedClassB inherits myBaseClass 'some more stuff End Class I then have a web service that has a method F...