vb.net-2010

Has Object in VB 2010 received the same optimalization as dynamic in C# 4.0?

Some people have argued that the C# 4.0 feature introduced with the dynamic keyword is the same as the "everything is an Object" feature of VB. However, any call on a dynamic variable will be translated into a delegate once and from then on, the delegate will be called. In VB, when using Object, no caching is applied and each call on a n...

Strong Naming an assembly using command line compile

I am trying to use NAnt in order to compile and sign an assembly using the vbc compiler. I have a project set up and am able to successfully sign the assembly compiling with VS2010. When I try to sign it using the command line I get this error: vbc : error BC30140: Error creating assembly manifest: Error signing assembly -- The parame...

What is a practical usage of Code Contracts in .NET 4.0?

In order to fully understand and take advantage of the new features and enhancements provided with the coming of the new .NET Framework 4.0, I would like to get an example of real-world application of the Code Contracts. Anyone has a good example of application of this feature? I would like to get a code sample with a brief explanati...

What is a good practical application example of the Dynamic Language Runtime in .NET 4.0?

I wish to better understand the real-world application of this new feature that consists the Dynamic Language Runtime (DLR). I would like: Brief explanation of how it could be used; A brief sample code that shows how to take advantage of it. Thanks! =) ...

What is the benefit and a common real-world practical application of using Tuples in .NET 4.0?

I have read about the Tuples provided with the coming-out of the new .NET Framework features, and still am I wondering about how it could be useful in real-world enterprise applications. Can one give me a brief explanation along with a simple but real-world code sample? Thanks! =) ...

Window that is supposed to be fullscreen in WPF touchscreen application is moving when inner listbox is scrolled.

I am writing a GUI application to run on a touchscreen device using VB.NET and WPF--it must be full screen at all times, like a kiosk app; the window must not be able to resize or move in any way. The window contains a ListBox that users can currently scroll through by dragging across the list. The problem I'm seeing is that when the us...

Linq to Objects and Anonymous Types

I'm new to Linq to Objects, and I've just hit the problem of anonymous types and scope. For example, this works just fine: Public Sub CreateResults() results = From e In CustomerList Join f In OrderList On CustomerList.ID Equals OrderList.ID Select New With {e.FirstName, e.LastName, f.Ord...

What Does a double assignment in a VB.NET assignment accomplish?

I (new to VB.NET) am doing some code maintenance on a function that sometimes throws an exception "error converting string "False" (or "True") to type Integer." What I found was something equivalent to this someVal is a string, someFun1 returns an Integer and someFun2 takes an Integer as a parameter ... someVal = someVal = someFun1() ...

Can we use TypeIdentifierAttribute in .NET without COM?

I am curious if it is possible to make 2 interfaces in .NET (either in the same assembly or in separate assemblies) that can be treated as equivalent, using the new TypeIdentifierAttribute attribute. I have not found a way. I've seen some stuff on the internet that suggest this eventually would be possible, but it kinda looks like the ...

vb.net insert record into dataset cell from a loop

For j = 0 To wcData.Tables(0).Rows.Count - 1 For i = 900 To 1700 wcData.Tables("db").Rows(j)("range") = i Next Next trying to insert "i" into each column cell of "range" any suggestion. Thanks. ...

How to prevent extra black pages in an rdl report file?

In my design view my report fits to one page, but when I print and export the file it creates extra blank pages displaying the header and footer. How can I fix this? ...

VB.NET 2010 and MySql - handling DB NULLs for lazy people

Hi, I want to initialize a class with data coming from a MySql db. Some fields can be null: Dim dr As MySqlDataReader = ... Dim item As New Item(dr.GetInt16(0), dr.GetString(1), dr.GetString(2)) Suppose the last two fields could be NULL In the db, so that calling GetString on that field causes an exception. I could certainly write ...

Creating an executable file using INNO SETUP Compiler 5.3.8

Hi Everybody, i have a problem when i create an executable file of my application created using VisualStudio 2010 and MSAccess 2010. I instal the application and I create a shortcut but when i run the application an error is generated saying that the Data Base file is not found in the same directory of the shortcut (when i create a shor...

Problems with running WMV in VB.Net

Hello, I just finished building my program, but I noticed that vb.net (2010) creates two dll files ( AxInterop.WMPLib.dll & Interop.WMPLib.dll ), when I tried to run the application without having those two files in the same directory, it crashed right away!!! Is there a way, to have the WMV components running without using any addition...

How to change gridview font?

How change gridview font?in windows form ...

VB 2010 Express: Text-to-speech

Hi, I'm very confused about how to get TTS working in VB 2010 Express. I read several how-tos, each of them showing how to do TTS in a different way (through System.Speech, adding a reference to Microsoft Speech Object Library, using SAPI etc.). Unfortunately none of them works out-of-the box for me, so I need to install additional packa...

wsdl.exe : how to generate proxy code when having same element name in operation?

Hi All, I have a single WSDL file with many operation. But each of the operation soap body has the same element name , but in different namespaces. e.g operation1 has soap.body.op1:Service and operation 2 has soap.body.op2:Service , where op1 and op2 are namespace prefixes. When i generate my proxy code using wsdl.exe , he generated cl...

writing a sbkey in registry in vb.net

Dears good morning to all I'm using the following code to open and then write a subkey in the registry Private Sub RegSubKeyCreates(ByVal sKeyPath As String) Dim RegKey As RegistryKey Dim SubKeyParam() As String = Nothing SubKeyParam = Split(sKeyPath, "\") RegKey = Registry.CurrentUser.OpenSubKey(SubKeyParam(0...

Thread safe variable in VB.NET

Is this the right way of declaration dbreaders when mulitple users access the same page? public dbReader as system.Data.IDataReader at class level or Dim dbReader as System.Data.IDataReader in each function inside a class. What would be the best practice to make the dbReader thread safe in VB.Net? Does declaring them as static makes ...

VB.net application crashes without specific error

Hi, I developed one application in VB.Net 2010. It worked fine on my laptop. Now when I run this on another PC, it just crashes and give windows error as below. Application: CallinkMig.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.InvalidOperationException...