vb.net

WIndows Forms Window Load method not completing

So in my window onLoad method I am pre-populating a grid with values retrieved from a database. Here is the method below for the window load: Private Sub winMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ''#Load Grid Dim dt As New DataTable With dt .Columns.A...

How to Call A .NET Created DLL in VB6 Application?

I need to call a VB.NET DLL in VB6 application, does anybody has any ideas? Thanks a lot. ...

asynchronous web services between different platforms

I am writing web services with VB.NET (2.0). The client side will use different technologies such as Java and Siebel. So, if I write asynchronous web services, is it possible for different platforms to consume them? I know it is quite easy with a consumer having .NET platform, but not sure for different platforms. Is it enough for them t...

Child window open inside of the main window form

I have create a project with one main form window and also i have to use a number of other forms as well. now i want to open these other forms inside the main window and not outside. I'm using Visual Studio .NET 2010 as developing environment. is there anyone who can assist me on this? Thanks ...

TableNewRow-Event of a DataTable in VB.net

I have a DataTable-Property: Public Property Files() As DataTable Implements Presenter.ISearchSetup.Files Get Return _files End Get Set(ByVal value As DataTable) _files = value RaiseEvent OnPropertyChanged() End Set End Property Private WithEvents _files As DataTable Now I add a row with: Dim r...

vb code converted to c# compilation error

Hi, I had a code for getting the hdd id written in vb.net Now I need to re-write the code into c#. I have converted the vb.net code to c# but it is not compiling. Below is the vb.net code Dim hdCollection As ArrayList = New ArrayList() Dim searcher As ManagementObjectSearcher = New ManagementObjectSearcher("SELECT * FROM Win32_DiskDr...

OpenMappedExeConfiguration vs. OpenExeConfiguration

Hi, OpenExeConfiguration has 2 overloads: ConfigurationManager.OpenExeConfiguration (ConfigurationUserLevel) ----- (1) ConfigurationManager.OpenExeConfiguration (String) ----- (2) OpenMappedExeConfiguration has only 1 prototype: OpenMappedExeConfiguration (ExeConfigurationFileMap fileMap,ConfigurationUserLevel userLevel) ---...

How to call Winforms-style Invoke/Delegate from MVVM?

Hi, I'm hacking away at some code which seems to have been started, at least in theory, as an MVVM project in Expression Blend, by my predecessor at this company. I've got a thread running in the background, which is running some operations on items as they happen. In order to prevent any clashes, I've also got that thread running any ...

How to Compare two objects regardless of data types in vb.net

As the title implies, I want to compare two objects whose type may be diffrent. For eg, I expects 'true' for comparing 1000.0(Decimal) with 1000(Double) . Similary, it should return true if I compare 10(string) and 10(double) . I tried to compare using Object.Equals() , but it did NOT work.It return false if two objects have different ...

vb.net 2008 / Imports System.Transactions ?

Using vb.net 2008. I am trying to use TransactionScope but when I put "Imports System.Transactions" at the top of my module it is not taking it. Do I need to do some setting or something? ...

Missing form after Minimize - Windows form application

I try to minimize my form to system tray but when I do, the form disappears and the notification icon doesnt work :( What am I doing wrong? Private Sub Form1_Resize(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Resize If Me.WindowState = FormWindowState.Minimized Then Me.Visible = False ...

Assigning an array of structure to another array of same structure

In Vb.net I am trying to assign an array of structure to another array of same structure Dim info() As assemblyInfo Dim info2() As assemblyInfo Structure assemblyInfo Dim Name As String Dim ClassTpys() As ClassTyp End Structure Private Sub test() info2 = info any change in ifo gets reflected in info2, th...

Traversing in Vb.NET

Hi. I need to traverse in VB.Net I have 4 command buttons namely Move First, Previous, Next and Last. I m using MS Access as my6 back end. If i press move first i should get first element If i press move previous i should get prev element If i press move last i should get last element If i press move next i should get next element ...

VB.net sendmessge to console box

Hey all, i am trying to send some text to a console box (dos box) from my vb program but i can not seem to get it working. Here is my current code: Dim blah As Long Private Const WM_GETTEXT As Integer = &HD Declare Auto Function SendMessage Lib "user32.dll" (ByVal hWnd As IntPtr, ByVal msg As Integer, ByVal wParam As IntPtr, ByVal lPar...

VB.net - creating a hashtable with values

Is it possible to create a hashtable "pre-populated" with values? i.e. something like: dim myHash as new Hashtable() = {"key1", "value1", "key2", "value2" } ...

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 ...

Visual Studio 2010 designer error

Hi, I'm having a problem with some custom forms I developed. This form worked perfectly with VS2008, but is causing an error with VS2010. Going back to VS2008 is a worst case scenario option for various reasons. Anyway the problem - When I try to view a form of type FormWithError in design mode I get the standard "To prevent possible...

Make connection to database only once on page load

When I load my page I populate my repeater with the following code. Dim conn As Data.SqlClient.SqlConnection Dim Comm As Data.SqlClient.SqlCommand Dim reader As Data.SqlClient.SqlDataReader 'conn = New Data.SqlClient.SqlConnection("Server=localhost\sqlexpress; " & _ '"Database=MyDB; Integrated Se...

What's the best way to capture all doubleclick events in a DataGridView?

I'm writing a Windows Forms app that uses a DataGridView control. I have row select enabled on the control. I would like to trap the DoubleClick event, but it doesn't seem to fire reliably - I often have to double-click on a row 2 or 3 times before the event is triggered. Could anyone point me to a way to capture this more reliably? ...

Does a form timer maintain state during sleep/hibernate?

If I have an event that starts a timer with an interval of say, 30 minutes, and 15 minutes later, the computer the app is running on sleeps (Suspend to RAM) or Hibernates (Suspend to Disk), and is brought back online after ten minutes, will the timer raise its Tick event in 5 minutes (30 minutes REAL time from the start) or 15 minutes (3...