vb.net

convert from javascript to servervalidate in vb.net

this is my javascript code - function ae_Validate(sender, args) { var cbs = document.getElementsByTagName('input'); args.IsValid = true; for (i = 0; i < cbs.length; i++) { if (cbs[i].type != 'checkbox') continue; if (!cbs[i].checked) continue; var price = document.getElement...

How to get an Integer Value from a ComboBox using a DataTable as its DataSource

I am using code similar to this to populate a combobox with items from a database. The display works fine, but when I try to get the combobox.SelectedValue it is returning a DataRowView, where I need an integer. Obviously this is becuase I haven't casted the value to an integer, but the function, CInt(cboPosition.SelectedValue) is thro...

Subversion: How to unversion the BIN and OBJ folders

In subversion/TortoiseSVN, I am wondering how to un-version a directory. We have a large number of projects, each with a BIN and OBJ folder which are under source control. I want to delete these two folders from subversion, but keep the folders locally. I tried the "Delete (Keep local)" option, and that works on my machine. However w...

LINQ in VB InvalidCastException

Hi, I run into this problem System.InvalidCastException: Unable to cast object of type 'System.Data.Linq.DataQuery1[Student]' to type 'System.Collections.Generic.List1[Student]' When I debug this function: Public Shared Function SearchStudent(ByVal firstname As String) As List(Of Student) Dim db As New DemoDataContext() Dim...

Long Delay when acces to Network Printer.

I have some Delay to access My remote printer, a RICOH offimatic point. I think this delay become from domain autentification. When I call PrintDialog, this delay is about 3 to 5 seconds. I use some .Net programs. Then when I print a report, delay becomes 4x the PrintDialog Delay (15-20 seconds). Standard Programs (c++) get a 1x del...

Null check always returns null, if removed returns Object reference not set to an instance of an object.

I have some code which gets child items for a menu via the GetChildren function which takes a list of menuData: Dim builtMenu As New List(Of MenuData)(_rawData.FindAll(Function(item) item.GroupingID = 0)) For Each menuData As MenuData In builtMenu If menuData.Children IsNot Nothing Then menuData.Children.AddRan...

VB.Net - What is the difference between AssemblyFileVersion & AssemblyFileVersionAttribute and AssemblyVersion & AssemblyVersionAttribute

I've inherited a VB.Net codebase which was VB 2005 and upgraded to VB 2008 consisting of around 100 projects I'm trying to re-version all of the components but have discovered some of the AssemblyInfo.vb files have an AssemblyFileVersion entry and some have an AssemblyFileVersionAttribute entry. Also, some have an AssemblyVersion entry...

populate a treenode from a treenode

I built a treenode to be populated from my network drives, from this treeview I would like to populate another treeview to show the files when the first one is selected. For example, if the user were to click on the c:\TestFolder then the second treeview would show the TestFolder, all sub folders and files. Below is my code, thanks. Imp...

Is there any other way to validate textbox values in VB.net

Hi, I am trying to validate textbox values during runtime in vb.net I have following code which is validating txtno from database table tblmachines. But i have problem with chartype and stringtype. Is there any other solution to fix that problem? Private Sub txtno_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms...

How to convert vb.net coded to WORKING c# code ?

Hi I want to convert the code at Webcam using DirectShow.NET to C#. It works perfectly in vb.net. I tried converting using an online converter, however I got about 30 errors, Any suggestions to what I must do next: This is the converter that I used : 1) Convert VB.NET to C# ...

Private Variable Instantiation: When Defined or Within Constructor?

I don't know if this has been asked before, but we're having a discussion about it today at my job. Should private variables (that are shared/static) be instantiated when they are dimensioned/defined, or is it a better practice to do this inside of a constructor? For example, this seems perfectly fine to me... Public Class IpCam ...

How to test than an XML string is well formed in .net

I'm looking for some code in .net to allow me to test an xml file to determine if it is well-formed. I am not validating the file against a schema at this point in my code, just testing that it conforms to xml specification for being well formed. Any assistance is appreciated. ...

Printing a form in VB.NET on Windows XP

Hi, I developed an application for a local company that required printing a chart and some data. I made the program on a Windows 7 machine using the PrintForm control. It printed just fine and I sent it to the company, but they are running it on WindowsXP and the program is crashing. I assumed that PrintForm would work on all Win operat...

Compare values from data source to string

Hey folks, I'm just stumped on what to do with this code, I'm just trying to implement a 'no duplicates' catch on my insert customer form, but it just slips through my if statement to the else everytime. This is the source. Also I tried a .Equals with the same results :( Protected Sub srcAllClients_Inserting(ByVal sender As Object, By...

VB.NET-Grid double click fires on single click

Hi all, Ok, here is a weird VB.NET Grid problem. I am sure it is really simple, but it doesn't make sense to me. I have a grid that displays data from a binding source. I have a method to handle the CellContentDoubleClick which will get the value of the cell and use that to do a new look up. This will generate a new datasource (with...

Is it possible to convert vb.net source to C++ ?

Are there any tools converting vb.net source to C++ eg gnu C++. I know that Mono can transfer the projects to different platforms but i would rather prefer to convert the source. Since all we know that .net uses its own binary libs not available to other complilers is there any tool at least converting vb.net to C++ .net? Thanks in adv...

Forms based authentication

If I wanted to make sure that AUTHENTICATED users were denied access to Enroll.aspx and UNAUTHENTICATED users had access how should my "allow/deny users" tags be set in the web.config? <location path="Enroll.aspx"> <system.web> <authorization> <allow users = "?" /> <deny users = "?" /> </authorization> ...

CSng() or x 1F ?

Suppose option Strict On; a and b - Integers Dim mySingle as Single = a / b ' implicit conversion error Solution A) Dim mySingle as Single = CSng(a / b) ' CSng Solution B) Dim mySingle as Single = a * 1F / b ' x 1F What solution is preferable? What solution to take if performance is important? ...

Please help with a database driven mail merge application embedded in a .net web application.

I am trying to have letter templates (word documents) that are stored in sql server VarBinary(max) to be accessed via a web application where they will be edited and saved back to sql server by directors of our company. Then various managers will be able to select an existing template (word document), make any additions, and mail merge ...

Why Oh Why won't VB.NET connect to this database?

Hi, First off, I can connect to both databases with SQL Server Enterprise Manager, so I know the servers are up and available. One of them is SQL1, the other is SQLTEST. In my program when I use the following connection string, it work connects just fine: conn = New DBConnect("Data Source=SQL1;Initial Catalog=SignInspection;Integrated...