vb.net

Can't access classes from different files in VB.NET Website

I've inherited a VB.NET website and it won't compile because the class1 in the file class1.vb refers to class2 in a file called class2.vb. I get the following error when trying to compile: Type Class2 is not defined. When I look in the object browser the classes are listed separately (i.e. not all grouped under the same namespace) ...

How do you name member variables in VB.NET?

I am generally not one to engage in subjective arguments over matters like variable naming, code formatting, etc. So I have no intention of starting an argument here. I just came across this (old) blog post which recommends not prefixing member variable names: Do not use a prefix for member variables (_, m_, s_, etc.). If you wa...

How to set an environment variable called CLIENTIP?

I was trying to use the sentence Environment.SetEnvironmentVariable("CLIENTIP", <value>) but the variable is not created. I used both an string variable and a constant to set the value. So, how can I do this to work? ...

How to properly read 16 byte unsigned integer with BinaryReader

I need to parse a binary stream in .NET to convert a 16 byte unsigned integer. I would like to use the BinaryReader.ReadUIntXX() functions but there isn't a BinaryReader.ReadUInt128() function available. I assume I will have to roll my own function using the ReadByte function and build an array but I don't know if this is the most effi...

VB.NET XML Literal Expression Expected with Linq to XML

I have the same problem as stated in this question, but the accepted solution there was a "works on my machine" answer. Here is my code: Dim document As XDocument = _ <?xml version="1.0" encoding="utf-8"?> <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="h...

Value was either too large or too small for an Int16 error

I am working on fixing a bug in VB that is giving this error. I am new to VB, so there is some syntax that I am not fully understanding. The code that is throwing the error says: .Row(itemIndex).Item("parentIndex") = CLng(oID) + 1000000 I understand that adding 1000000 is too much for an int16. I can't change that value (not right n...

C# to VB question

Hi, I can achieve in VB what the following C# snippet does but it seems very clunky since I perform a Linq query to obtain the events for the relevant user. Is there a neat way? ctx.FetchEventsForWhichCurrentUserIsRegistered((op) => { if (!op.HasError) { var it...

Inheriting a Base Form but Paste/Cut Commands Not Captured

I created a base form that has a specific size and an icon as a base for all forms created in my project (to be consistent in looks). The problem is, for some reason if I add a Text box to the Child form, I can no longer execute shortcuts like Copy (CTRL+C) etc into the Textbox. What should I do to handle this OTHER THAN writing code to...

Datagridview retains waitcursor when updated from thread

I have a DataGridView control in my Windows Forms Application. I am adding rows to the grid using a background thread. I change the form's cursor to Waitcursor when the process starts and back to Default when it ends. This works well for the form, but not for the grid. When the form's cursor is changed back to default, the grid's cursor ...

Run SQL Queries on DataTables, or similar, in .Net, without an RDBMS

I'd like to have a dataset or datatables, and be able to run SQL statements on them, without using any external RDBMS. For Example, to take take 2 datatables in a dataset and just join them outright with a SQL statement and Where clause, the result being a new datatable? For example if I have 2 datatables, named People and Addresses in...

Is there a way to find the browser window height and width in VB.Net without having using javascript?

I am needing to get the browser height and width of the browser window with vb. I can get these values by setting an ASP.Net hidden input control using javascript, after the page has loaded and a post back is done. I need to be able to get these values when the page initially loads so I can create an image based on those values. I am ...

VB.NET - Read lines from command line to Windows form possible?

Hey Overflow, I have an application which serves as a user interface for a spartan/command line program. I have the program running on a separate process, and my application monitors it to see if it is responding and how mush CPU it is utilising. Now I have a list of files in my program (listbox) which are to be sent to the application...

Help with Subsonic3 ActiveRecord LINQ query

I have the following subsonic entities TInvoiceHeader TAccountAssociation How can I achieve the following in LINQ (subsonic) SELECT * from TInvoiceHeader WHERE custid IN (SELECT custid FROM TAccountAssociation WHERE username = 'a') I need to bind the results to a GridView. Update: I tried Dim accounts As List(Of TAccountA...

Problem using ScriptManager.RegisterStartUpScript in user control - Script Error "function is not defined"

I have a aspx page which contains a User Control uc1 ans within uc1, there is another user control uc2. Now I need to call a javascript function in the uc2's page load. (I understand that the Pages are not properly designed, but I am sorry as this is an old application, I am not supposed to make any changes in the design) I am doing thi...

Timeout not working in SQL Connection

I have this simple code to test that a DB is ready: Function testlocalcon() As Boolean Dim constr As String = _clconstr Try Using t As New SqlConnection() constr = constr & " ; Connect Timeout=1" If Not t.State = Data.ConnectionState.Open Then t.ConnectionString = constr ...

Using MODI to extract text from OCRed PDF

Hi is it possible to extract text from an OCRed pdf file by using Microsoft Document Imaging? ...

VB.NET - Object reference not set to an instance of an object

I need some help with my program. I get this error when I run my VB.NET program with a custom DayView control. ***** Exception Text ******* System.NullReferenceException: Object reference not set to an instance of an object. at SeaCow.Main.DayView1_ResolveAppointments(Object sender, ResolveAppointmentsEventArgs args) in C:\Us...

which control have no event in.net

which control have no event in.net ...

Difference between tp(,) and tpo(1)()

Hi, I have this code, first I thougt it should be the same but i cant acces the info in the same way .. why is this??? Dim tp(,) As Integer = {{1, 3, 5, 9, 7}, {34, 3, 4, 5, 6}} Dim tpo(1)() As Integer tpo(0) = New Integer() {1, 3, 5, 9, 7} tpo(1) = New Integer() {34, 3, 4, 5, 6} For Each s As Integer In tp ...

i have problem to get new inserted columnID using sql

hi I have an identity column defined as int in sql . I use SCPOE_IDENTITY () to get the new inserted column id. this is sample of my code: Dim sql As String = "insert into infoHotel (nameHotel, knownAs1, knownAs2, knownAs3, knownAs4, streetAddress) values (N" & _ FormatSqlParam(hotel) & ",N"...