vb.net

Multi-level inheritance with Implements on properties in VB.NET vs C#

Let's say I have 2 interfaces defined like so: public interface ISkuItem { public string SKU { get; set; } } public interface ICartItem : ISkuItem { public int Quantity { get; set; } public bool IsDiscountable { get; set; } } When I go to implement the interface in C#, VS produces the following templated code: public cl...

Playing voice over modem from a Windows service

I'm developing a VB.NET Windows service which is costantly checking a BMS database for new alarms and making phone calls to warn operators remotely. I'm currently using a .NET TAPI wrapper and the SAPI 5.3 interop assembly, and the steps I'm taking to speak over the phone are: Initialize TAPI interface; Make the call to the operator's ...

VB.NET Visual Inheritance: Friend VS Protected

Why is it that some components/controls will not be inherited visually in a child form if they are declared with the access modifier Friend vs when they are declared with Protected. For example, I've got a DataSet object in my Parent Form that was initially "Friend" (I drag and dropped it to the form, so it was shown as a control in th...

Multi-level interface inheritance with .NET and COM Interop

This question is a follow-up to my last question with a reference to COM Interop. Let's say I have the following 2 interfaces and implementing classes: public interface ISkuItem { public string SKU { get; set; } } public interface ICartItem : ISkuItem { public int Quantity { get; set; } public bool IsDiscountable { ...

Capture screenshot Including Semitransparent windows in .NET

I would like a relatively hack-free way to do this, any ideas? For example, the following takes a screenshot that doesn't include the semi-transparent window: Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Shown Text = "Opaque Window" Dim win2 As N...

Declaring a string in C# vs VB.NET

In the middle of attaching a Google Custom Search Engine onto my page, I have a string which I would declare in C# as String rxPattern = "<(?>\"[^\"]\"|'[^']'|[^'\">])*>"; How do I convert it to a string in VB? I mean store the same value into the string variable rxPattern using VB/VB.NET? ...

what 3rd party control is used for the menu in inFlow Inventory applications

I want to implement a menu similar to the one used in the inFlow Inventory application. I see that the mozbar.dll is referenced but i cant get it to work in my application, and it is probably beyond my skill level to implement. Does anyone have any suggestions for other controls that might replicate the look and feel of the menu used i...

Add Multiple Datatable in Crystal Report

Hi guys, am new in crystal report, here wana to add 2 datatables in the crstal report' Private Sub btbPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btbPrint.Click ' Dim ds As New DataSet1 Dim t As DataTable = GetInvoice(txtBillNo.Text) Dim dt As DataTable = GetDCDetails(t.Rows(0).Item(...

VB.NET How to insert text at cursor position in a different window?

Hi, I have a small application that displays a listbox under the cursor position when the user uses a shortcut key. When the user double clicks a selection from the listbox I want to insert that selected text at the curser position of that opened window. Example: user has microsoft word open. He/she uses a shortcut key that displays a...

Need C# code converted to VB.NET for Silverlight "Export to CSV"

I'm looking to get the following code converted to working VB.NET code. I need to export data from a datagrid into the CSV format that the user can save off, and the code below from David in Dakota would work great, but it's in C#. Any help would be appreciated! This is for a Silverlight 4 site we're working on. private void exportHi...

I have sql query but how is the rest

I have following sql which is show previous days records from table. SELECT * FROM tblMeter WHERE (Date >= DATEADD(day, DATEDIFF(day, 1, GETDATE()), 0)) AND (Date < DATEADD(day, DATEDIFF(day, 0, GETDATE()), 0)) But how can I collect records with datetimepicker value in vb.net. Any help will be appreciated. Thanks ...

How to convert a string of key/value pairs to HashTable or Dictionary or ?

In VB.NET, how can I convert the following string into some kind of key/value type such as a Hashtable, Dictionary, etc? "Name=Fred;Birthday=19-June-1906;ID=12345" I want to extract Birthday or ID without having to split the string into an array. EDIT: I'd prefer not to split the string into an array in case the format of the string ...

SerializationException: Error Serializing Class that extends 'System.Configuration.ConfigurationSection'

I have ASP.net 3.5 application (VB.NET) using SQLServer (2005) Session State management. We are receiving a serialization exception (below) when using a certain component of our application that saves a custom object to session. This custom object inherits from an abstract class that inherits from a framework component ConfigurationSecti...

Print WinForms TextBox with Tab Formatting

I have been working on some code that prints a textbox that lists contact information. When I try to print it, it doesn't print out the tabs that I used to format the text. Here is my code: Private Sub PrintPage(ByVal sender As Object, ByVal ev As PrintPageEventArgs) _ Handles prndoc.PrintPage Dim fnt As Font = resultTextBox.Font ...

Unit Testing & Bug Repo for Vb.Net 2005

Working on a company using the .Net Framework 2 (vb6 and vb.net 2005) and a very rudimentary sourceforge setup, I'm kindof at a loss when I was tasked to "...find a suitable Open Source Unit Testing & Bug Tracking system..." for the team. Those were my superior's exact words. I know about the Team Foundation Server's capabilities, but ...

using VB.Net And/Or operators for logical short-circuiting: Any compiler-directive/workaround?

I found using AndAlso/OrElse, all the time, VERY annoying. It reduces code readability, especially when conditioning get complicated. Any suggestions? ...

Entity Framework SaveChanges - how to ignore ID / Identity fields on INSERT

VB .NET 4 WinForms application. I have a (DevExpress) grid bound to an IEnumerable(Of MyClass). Whenever a new row is added, the ID defaults to zero (0). On trying to SaveChanges, EntityFramework doesn't realise that being an identity field means it should ignore any contents on insert and just insert the other values. I can't specify n...

mobile application cannot see remote sql server!?

Hello all, I am sorry for bothering you with my probably low level question. I would like to develop a very very very simple application which will connect the MS SQL SERVER in my notebook and will be run at hand terminal-with windows mobile 6. Here is the code which i used : Dim strSQL As [String] = "SELECT COUNT(studentid) AS tot...

how to read only selected text from pdf files in vb.net - visual basic language?

how to read selected text from pdf files in vb.net - visual basic language ? ...

Force AutoComplete ListBox in a DataGridView on CellEnter

I have a DataGridView with a TextBox column (DataGridViewTextBoxColumn). I already set the AutoCompleteDataSource to a list of string values. Now, the default behavior of the TextBox column is to ONLY show the AutoComplete ListBox when something is typed. Is there a way to show/drop that ListBox on the CellEnter event or as soon as a use...