vb.net

Loading an Isolated dll into existing Appdomain and autoexecuting events

I have a solutions where three projects are running. One of my project is class library that is isolated from other two class. Now what I want to do is to load it into existing appdomain and auto execute its methods on some event occured from other assemblies in same domain. I have an event inside that, and i want to execute that event ...

VB.NET: what does the 'friend' modifier do?

What does the 'friend' modifier do in VB.NET? Why is it the default modifier for GUI components in Visual Studio? ...

VB.NET: how to require CheckedListBox to have at least one item selected in WinForms

With the CheckListBox in VB.NET in VS2005, how would you make it compulsory that at least one item is selected? Can you select one of the items at design time to make it the default? EDIT: What would be best way to handle the validation part of this scenario? When should the user be required to tick one of the boxes? ...

How do I append Word templates to a new document in VB.NET?

I'm poking around to see if this app can be done. Basically the end user needs to create a bunch of export documents that are populated from a database. There will be numerous document templates (.dot) and the end result will be the user choosing templates x y and z to include for documentation, click a button and have the app create...

VB.NET: how to prevent user input in a ComboBox

How do you prevent user input in a ComboBox to that only one of the items in the defined list can be selected by the user? ...

VB.Net Linq Datatable Exists

I would like to use Linq instead of below function : Friend Function IsCollectionInTable2(ByVal apps As DataTable, ByVal collectionId As String) As Boolean For Each row As DataRow In apps.Rows If row("CollectionId").ToString = collectionId Then Return True Next Return False End Function The best I can do is below: ...

Daylight savings information for converting UTC dates

I am developing reports using Microsoft SQL Report Builder 2.0. One of my requirement is to display the timezone information by passing "Timezone Offset" (-08:00) as a parameter to the report. Based on the offset value, we convert a UTC date to its appropriate timezone value (using VB.NET) and display the same. However, this does not con...

ASP.NET: convert UNC to file:/// URL

I need to convert UNC paths to file:/// URLs, e.g. \\fileserver\share\dir\some file.ext --> file://///fileserver/share/dir/some%20file.ext Is there some built-in function for this? ...

VB.NET LINQ Result Set Manipulation.

I have a table that looks like this: ID / Description / textValue / dateValue / timeValue / Type 1 / FRRSD / NULL / 2010-04-16 00:00:00.000 / NULL / classdates Now I've got a LINQ command to pull only the rows where the type is classdates from this table: Dim dbGetRegisterDates As New dcConfigDataContext Dim getDates = ...

Aggregation relationships and instantiating objects from database storage (vb)

I have a small application which allows users to create accounts and then award 'points' to each other. UserAccount is an object, and so is Point, and there is an aggregation relationship between them: each UserAccount has a member variable (PointHistory) which is a collection of Points. The Point object simply contains properties for w...

How do I limit the posible options to be assign to a .net property

Hello how can I have like a catalog for a property in .net VB .. I mean if i have Property funcion(ByVal _funcion As Int16) As Int16 Get Return _funcion End Get Set(ByVal value As Int16) _funcion = value End Set End Property I want to be able to assign to this property a limited number of options. E...

Why can you assign Nothing to an Integer in VB.NET?

Why am I allowed to say: Dim x as Integer x = Nothing in VB.NET, but I can't say: int x; x = null; in C# ? ...

Horizontally Flip a One Bit Bitmap Line

I'm looking for an algorithm to flip a 1 Bit Bitmap line horizontally. Remember these lines are DWORD aligned! I'm currently unencoding an RLE stream to an 8 bit-per-pixel buffer, then re-encoding to a 1 bit line, however, I would like to try and keep it all in the 1 bit space in an effort to increase its speed. Profiling indicates th...

.NET Process.Kill() in a safe way

I'm controlling a creaky old FORTRAN simulator from a VB.NET GUI, using redirected I/O to communicate with the simulator executable. The GUI pops up a "status" window with a progress bar, estimated time, and a "STOP" button (Button_Stop). Now, I want the Button_Stop to terminate the simulator process immediately. The obvious way to do t...

When I add a database table to a DBML file via LINQ to SQL, I get a slew of compiler errors.

Whenever I add a certain table to a DBML file via LINQ to SQL, I get 102 errors in my VB NET project. Some of the errors: Error 1 Attribute 'TableAttribute' cannot be applied multiple times. C:\Documents and Settings\zchoy\My Documents\Virtual EMS Deployment\Life And Death\Life And Death\ShearwaterEMS.designer.vb 74 2 EMS Rea...

Rows and Column of Excel File

It is possible to write a code that specifying the rows and column of spread sheet in terms of NUMBERS and NOT LIKE (B2:D6) Example: excelSheet.Range("B2:D6").Interior.Color = RGB(100, 100, 255) instead of B2 and D6 I want to write 5 rows and 3 column.. It is posible to write in vb.net 2003 code? ...

How to get the reference of latest version of MS Excel in VB.net application?

I am using Excel Interop in my VB.net application. I am using Microsoft Office 11.0 Object Library and Microsoft.Office.Interop.Excel for excel automation. Both the dlls are for Office 2003. My question is, how can I get my project to refer to the latest version of MS Office( say Office 2010) ...

How to insert multiple records from Vb.net to SQL Server 2005 table ?

I have 40000 records in my DataTable. I want to insert all the records into SQL Server. I am using vb.net 2008 and SQL Server 2005. Currently I am using XML to pass from vb.net to SQL Server 2005 but it will give me network error. Is there any other way I can achieve this ? ...

How to delete multiple rows from datatable in VB.NET 2008?

How to delete multiple rows from datatable in VB.NET 2008 without looping? I do not want to delete from the database. I want to delete from the local data table. I know the Select method and also Remove and remove at method too. But that needs looping to delete the rows from the data table. I have 40000 rows and I want to delete sele...

Hook into Application_Start in a HttpModule

I’m implementing a simple HttpModule, where I want some code to run when the web application is started. But I’m surprised to find that the Application_Start event I would normally use from Global.asax is not available from a HttpModule. Is that correct, or am I missing something here? How do I hook into the Application_Start event from...