vb.net

VB.NET, Castle ActiveRecord and MySQL: Duplicate entry in a unique field

Hi. When user inserts a duplicate entry in a unique field, Castle ActiveRecord throws the following exception: Castle.ActiveRecord.Framework.ActiveRecordException was unhandled Message="Could not perform Save for SerieNotaFiscal" Source="Castle.ActiveRecord" StackTrace: at Castle.ActiveRecord.ActiveRecordBase.InternalSave(O...

Can I find a file by filename only (i.e. extension unknown)

We have a network folder that is the landing place for csv files processed by different servers. We alter the extension of the csv files to match the server that processed the file; for instance a file with the name FooBar that was process by Server1 would land in the network share with the name FooBar.Server_1. The information I hav...

INotifyPropertyChanged and Auto-Properties

Is there a way to use INotifyPropertyChanged with auto-properties? Maybe an attribute or something other, not obvious to me. public string Demo{ get;set; } For me, auto-properties would be an extremely practicall thing, but almost always, I have to raise the PropertyChanged-event if the property value has been changed and without ...

VB.NET WCF Soap Web Service Variables Missing

I have created a WCF VB.Net Soap service. The service compiles and runs, but at runtime, only half of the variables passed to the function via a soap request are received. Would anyone please be able to help me determine why only part of the variables are being passed in. Thanks in advance. Interface Imports System.ServiceModel Impo...

Error When Instantiating an Object

I am in the middle of (trying) to create a Class Library available for use in VB6/VBA. With some assistance received here I have now done the following: Created a Class Library Project in Visual Studio 2010 Express and put the code in a Class Module. Learned I needed this wonderful thing called an "Interface"... Made one of those:) I o...

How to extract image from embedded resource programmatically in VB .NET

I have a small vb.net app that have a few images in an embedded resource. Is there a way I could extract one of those images to a folder from the same exe that contains the resource?, like clicking a button, selecting a folder to save it and extracting the image there. ...

Why does my custom HttpResponse throw exception on HttpResponse.End()?

I'm writing some code in which I need to use my own HttpResponse object to capture the output from a method on another object that takes an HttpResponse as a parameter. The problem is, this other object (which I cannot modify) calls HttpResponse.End(), which causes an "Object reference not set to an instance of an object" exception to b...

Ping to stored procedure to know execution completed in .net?

I have to execute a stored procedure. When I execute that, I have to keep on check (ping) whether that execution is completed or not. The I will update a label. Do we have any way in c# to do that? ...

How to share an include file with inline server side code with VB.Net files and c# files

Hey guys I've got a lot of legacy reports, some in vb.net and some in c#. This code base uses include files to add a centralized header and footer to each page like so. <!--#include file="/includes/header.inc" --> I need to add some server side code into these header files to add some functionality but because the reports dont share ...

How can it get VB not to auto generate code for my component.

I build a component class it extends a combo box and generates some random numbers. But when I drag and drop my component from the toolbox to a form it auto generates Me.Randtest1.Items.AddRange(...) in the Designer which uses static numbers. The idea was to have different numbers each time and not the same. Imports System.Windows.Form...

Make Groupbox's controls readonly when is radiobutton clicked in vb.net

I have many textbox inside a group box so when radio button is clicked i want to make these controls readonly. Is it possible,and again on another radio button click again i want to make readonly false in vb.net. ...

How to work continuously on other pages while executing stored proc in asp.net?

I have a stored procedure that I need to execute from asp.net button , It takes more than 30 mins to execute. So here I need to show a message like "In Process" while execution and disable couple of links..Once the execution is done I need to show "Last processed data and time" and enable the disabled links. So in "In Process" stage w...

Dealing with VB.NET Linq formatting in Visual Studio?

Does anyone else wrestle with getting VB.NET Linq code formatted the way they want it in Visual Studio? What are some tricks you have for how do you deal with it? I know that Visual Studio lets you uncheck the option for "Pretty listing (reformatting) of code", but most of the time it's a really handy setting to keep on. And with a te...

Force the user to select minimum two check boxes in each section in gtrid view?

I have to select checkboxes besed on group column values. If you see below gridview, column 3 (GroupNo) has 1,1,1,1,2,2,2,2....etc (this column data is not static, will change based on page index. i.e PageIndex =2 may starts with 7,7,7,8,8,8,8,8,9,9,9 etc). Now My question is. In every sectio/Group User must and should select minimun ...

Merging MDI toolbar

In .net MDI application the menu of child form automatically is merged to the menu of parent form. Is there a way to do similar thing with the tool bars.The concept is to send the toolbar of active child to the parent toolbar stripe. I found http://community.devexpress.com/forums/p/5696/24663.aspx but could not achied it. ...

How to make a "screen region selector" to capture a region of the screen in .NET?

I've used this http://www.vbforums.com/showthread.php?t=385497 sample to capture the screen and save it to an image, I'd like to know if someone have a sample for a "selector" for selecting the region of the screen to capture, like camstasia or camstudio have. I dont want to understand how it works, just need a code sample but couldnt f...

How to remove items from multidimensional List using LINQ

Public Class GroupSelect Public Property RowNo() As Integer Get Return m_RowNo End Get Set(ByVal value As Integer) m_RowNo = value End Set End Property Private m_RowNo As Integer Public Property GroupNo() As Integer Get Return m_GroupNo End Get Set(ByVal value As Integer) m_...

VB.NET: Assign value to variable inside an IF condition?

Hello, is there any possibility to assign a value to a variable inside an IF condition in VB.NET? Something like that: Dim customer As Customer = Nothing If IsNothing(customer = GetCustomer(id)) Then Return False End If Thank you ...

Simple Question - Shallow Copy (VB.Net)

OK, I always get confused about this. Let's say I have this code. Public Sub Bar(byRef pMap as clsMap) Dim foo as new FooClass() pMap.listOfFoo.Add(foo) end Sub This would mean that referencing 'Foo' or the item stored in 'listOfFoo' would reference the same object, right? If I was to change a property of 'foo' - but not change it t...

Running powershell scripts from within a .NET windows app

I'm needing to run scripts from within a vb.net windows app. I've got the scripts running in the background fine; Using MyRunSpace As Runspace = RunspaceFactory.CreateRunspace() MyRunSpace.Open() Using MyPipeline As Pipeline = MyRunSpace.CreatePipeline() MyPipeline.Commands.AddScript("import-module -name " & module...