vb.net

Why are string lengths different between JavaScript and VB.NET (posted back via ASP.NET form)?

When I trim a multi-line textarea in JavaScript to a certain length (JS: .substring(0, x)), and that field is then posted back, checking the length in VB.NET will still find a length greater than the trim length from JavaScript (VB: .Length > x). I have already determined this was a problem with line breaks, but I wanted to make sure no...

LINQ to Objects - Is not in?

I have a generic list of custom objects and would like to reduce that list to objects where a specific property value is not in a list of exclusions. I have tried the following: Private Sub LoadAddIns() // Get add-in templates Dim addIns = GetTemplates(TemplateTypes.AddIn) // Get the current document Dim sectionId As String = C...

SQL and ADO.net: Too many arguments specified with output param

ALTER PROCEDURE dbo.uspGetOrderTrackingHeaderInfo @ContractID varchar(9) , @SalesRepID int , @StatusID int , @TypeID int , @StartDate datetime , @EndDate datetime , @Identity int = null output AS INSERT INTO [dbo].[tblOrderTracking] ([ContractID] ,[StatusID] ,[TypeID] ,[SalesRepID] ...

Castle ActiveRecord - Command line Assemblies vs. VB.Net Assemblies Problem

Ok, so here is the deal. I have this project called Import.exe. It will look for a file, parse it and use Castle AR to import. This runs great at the command line. Now that same Import.exe needs to be ran from and VB.NET web program after a file Upload. I am using System.Debug.Process.Start to call the exe. The file uploads fine, the p...

VB.net: CInt returning -1 on a (seemingly valid) string

Hi, I have a strange problem where CInt (as well as Convert.ToInt32 or even Val) return -1 for a string "500". Using Gurock's SmartInspect for logging, I've checked all values at runtime (SiAuto... logs something, I'm posting the log below the code). Would appreciate some hlp :) Thanks Michael Si.Auto.Main.LogString("QueryString.q1...

.NET Default Properties Error

I have a VB.NET project where I am able to iterate through the keys and values collections of a dictionary object using an index: MyDictionary.Keys(idx) MyDictionary.Values(idx) When this code is taken from the test project and placed into the real project I get the following error: 'System.Collections.Generic.Dictionary(Of ...

Word wrap in Windows Forms (vb.net)

hai how to do word wrap in drawstring in vb.net 2005. please tell me ...

Proxy Addresses do not return x500

Heloo all, Dim search As DirectorySearcher = New DirectorySearcher(entry) search.Filter = String.Format("(& (objectClass=user)(samAccountName={0}))", "canallb") search.PropertiesToLoad.Add("proxyAddresses") Dim proxyNames As StringBuilder = New StringBuilder() Dim propertyCount As Integer = resul...

Error After Encryptingweb.config

I encrypted the AppSettings part of my web.config, tested it on my machine and it worked, but when I uploaded to use it online it gave me an error: Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below a...

vb.net problem running a command

the following runapplication won't work Private Sub RunApplication(ByVal ProgName As String) // String of text as a command to execute with the command line interpreter Dim strApplication As String = "cmd.exe/c" Dim ProcessID As Integer strApplication = strApplication & " " & ProgName & " > C:\tool.tmp" ...

How do I make a property public get but private set in vb.net?

I just stumbled over this in some C# code...: public Foo Foo { get; private set; } How can I do the same thing in vb? ...

Best practice for renaming property/method names that are reserved words?

I'm creating a car class. Make and model are properties but both make and model appear to be reserved words in C#. What's the best practice for naming properties/methods when your preferred name is a reserved word? My first instinct is to call the properties CarMake, CarModel (so a convention of ClassNamePropertyName). Is there some bet...

Can you inherit a sub new (Constructor) with parameters in VB?

In the code below I recieve the compile error "Error Too many arguments to 'Public Sub New()'" on the "Dim TestChild As ChildClass = New ChildClass("c")". I do not recieve it on "TestChild.Method1()" even though they are both on the base class I am inheriting from. Public Class BaseClass Public ReadOnly Text As String Public Sub...

How can I calculate pi (π) in VB

Does any one how can I calculate pi (π) in VB?? example: how can I calculate 2π in VB?? ...

Placing a variable from my Code Behind inside Repeater Control for NavigateUrl.

This is my Repeater <asp:Repeater ID="blogRepeater" runat="server"> <ItemTemplate> <br /> <asp:Image ID="Image1" runat="server" Height="56px" ImageUrl='<%= string.Format( My_Variable) %>' Width="64px" /> <asp:HyperLink ID="HyperLink2" runat=server NavigateUr...

copying from a tab delimited text file to itself

I have a tab delimited text file as so : name \t loan period \t loan amount John \t 5 years \t 6000 Sarah \t 5 years \t 6000 Jane \t 1 month \t 100 I'm looking to copy the lines where "loan period" = "5 years" to where "loan period" = "1 month", in order to show the comparison. The new lines would be appended at...

Cannot execute stored procedure with ADO.NET Entity Framework

I've created a simple parameterless stored procedure which I've pasted below. I've imported the stored procedure to my Entity Model and created a Function Import. The function in the model is never created and I am unable to execute this stored procedure using the ADO.NET Entity Framework. I've opened the .edmx file in XML view and have ...

Custom Validator

Hi I want to use a validator to compare 2 text box in such a way that , If V is in Text box 1, means User must type any of the numbers prefix V in Textbox 2 (V00001 to V00050).Other than V ,if they type any other Letters means error message must be shown. Just like that if C is in TextBox 1 means user must type C00001 in TextBox2.(or...

Why AND two numbers to get a Boolean?

Hi All, I am working on a little Hardware interface project based on the Velleman k8055 board. The example code comes in VB.Net and I'm rewriting this into C#, mostly to have a chance to step through the code and make sense of it all. One thing has me baffled though: At one stage they read all digital inputs and then set a checkbox ba...

A Data Structure to represent bookable timeslots

What suggestions do people have for a timeslot data structure? I have a number of activities and I'm planning to display them in a datagrid with days as columns and timeslots as rows. This suggests to me a timeslot data structure with 5 properties for the five days (the columns) for every value I want to use e.g. a timeslot ID and the n...