vb

What are some best practices / conventions / guidelines for ASP.NET or C#?

Long ago I read a great book on C# and Visual Basic best practices: Practical Guidelines and Best Practices for Microsoft Visual Basic and Visual C# Developers by Francesco Balena, Giuseppe Dimauro This book was very helpful to me in its time, which dates back to ASP.NET 1.1. Please list some current best practices for ASP.NET, C#, ...

What could cause a VB.NET application to crash before running any code?

My VB.NET application compiles, installs and works fine on the development PC. However, when I take the install package elsewhere, it installs ok but crashes before any code is executed. The error is " has encountered a problem and needs to close..." I have removed all references to external files e.g. icon files etc. I have only one...

How can I add an icon to an OCX made with Delphi so that it is visible in VB?

I made an OCX with Delphi 2007. Now my customer claims that there is no icon in his VB when he installs this OCX. How can I add such an icon to my OCX? ...

Association end is not mapped in ADO entity framework

I am just starting out with ADO.net Entity Framework I have mapped two tables together and receive the following error: Error 1 Error 11010: Association End 'OperatorAccess' is not mapped. E:\Visual Studio\projects\Brandi II\Brandi II\Hospitals.edmx 390 11 Brandi II Not sure what it is I am doing wrong ...

.NET 1.1 and .NET 2 config files working together

I have inherited a rather large project consisting of an application written in VB6 and several DLL's and ActiveX controls written in VB6, VB.NET 1.1 and VB.NET 2. I want to change one of the settings for one of the DLL's written in VB.NET 2 that is in its application.dll.config file, but it seems to be having no effect. My main VB6 app...

How do you explain to a sales person that programming is really difficult and takes time.

I often work with sales and marketing types that cannot figure out how to use Excel, let alone understand the scope of their requests from a technical perspective. Of course, it would not be fair to expect them to, but that still leaves me with a problem. What is the best way to show marketing and sales types that they have asked for...

How to deal the item of a collection which belongs to another collection

Hi, I have a problem in reading and loading items of a collection which belongs to another collection in vb 2005.Those are all nodes of xml file. For exemple: Toto is a node in xml file, an item of collection Tocollect and also a child-node of Tocollect, Tocollect is an item of Collect and a child-node of it. When write the code, are ...

Why is this file always saved as FALSE.xls ?

Hello! I wrote a VB script that creates an .xls file, based on .xlt file. Then it calls a macro from the .xls file that populates it with information from a database. In the last step the script saves the .xls file on the disk. I did this before with VB and Excel 2003. Now I upgraded to Excel 2007 and before it saves the file, a windo...

How to automatically answer yes in a dialog box in VB script ?

How to automatically answer yes in a dialog box in VB script ? ...

WinForms Multiline Textbox, Enter key insists on moving focus out of textbox.

I've got a multiline textbox and a button below it. VB.NET, WinForms, .NET 2.0 System.Windows.Forms.Textbox Multiline = True AcceptsReturn = True AcceptsTab = False CausesValidation = False No Events explicitly coded. I'd like the Enter key to insert line-feeds and never move the focus to the next control (the button). I'd like ...

VB6 Can IsNumeric be wrong?

Is it possible to test a string with IsNumeric() and for it to return true, but when you cast that same string to an integer using CInt() and assign it to a variable of type integer that it will give a type mismatch error? I ask because I was getting a type mismatch error, so I used IsNumeric() to check the string was numeric before try...

validating user input tags

I know this question might sound a little cheesy but this is the first time I am implementing a "tagging" feature to one of my project sites and I want to make sure I do everything right. Right now, I am using the very same tagging system as in SO.. space seperated, dash(-) combined multiple words. so when I am validating a user-input t...

Mixed Language Programming, VB and C++, noob problems with API and pointers

My problem is with understanding the finer point of mixed langage programming and accessing API's in external libraries. My skills at C++ are nonexistent and at VB, mediocre. I have a c++ dll compiled (portaudio library), and am trying to access it from VB (Visual Studio 2005). I am getting MarshallDirectiveException errors when call...

Would you develop in VB and then convert your code to C# just to have your entire team use one language?

I'm not considering this - I'm comfortable with C# and VB, but an expert in neither. But, some on my team have expressed an intention to do this since we're moving toward C# as a standard. ...

Return Inherited Generics as Base Generic

I have BaseAbstractClass(of T as WebControl) (VB Generics) which inherits WebControl. BaseAbstractClass is inherited by ConcreteWrapper1, ConcreteWrapper2, and lastly, to shake things up a bit, ConcreteWrapper4. Each of these would inherit BaseAbstractClass using a different class inherited from WebControl. What I would like to do is...

Passing VB Callback function to C dll - noob is stuck.

Callbacks in VB (from C dll). I need to pass a vb function as a callback to a c function in a dll. I know I need to use addressof for the function but I'm getting more and more confused as to how to do it. Details: The function in the dll that I'm passing the address of a callback to is defined in C as : PaError Pa_OpenStream( PaSt...

Asp.Net OutputCache and Expiration

I am using the Asp.net OutputCache on a page containing a usercontrol that in certain circumstances when the usercontrol is edited i want to be able to expire the page cache and reload the page with fresh data. Is there any way i can do this from within the usercontrol? If not, what are some other methods of caching the page that will ...

What's the deal with this Lambda?

Dim count As Func(Of Integer, Boolean) = Function(x As Integer) x = 1 If (count(GetSelectedCount())) Then 'Proceed Else MessageBox.Show("You can only select one item at a time.", "Multiple items selected", MessageBoxButtons.OK) End If GetSelectedCount returns the number of items checkemarked in a grid. ...

Why is short-circuiting not the default behavior in VB?

VB has operators AndAlso and OrElse, that perform short-circuiting logical conjunction. Why is this not the default behavior of And and Or expressions since short-circuiting is useful in every case. Strangely, this is contrary to most languages where && and || perform short-circuiting. ...

Converting Value Type of a Dictionary in VB.net

Public Class A Public Class B : Inherits A Dim DictA As Dictionary(Of Integer, A) Dim DictB As New Dictionary(Of Integer, B) DictA = DictB This doesn't work, as the type can't be converted. Is this somehow possible? ...