I have this function:
Public Sub DoStuff(ByVal type as System.Type, ByVal value as Object)
End Sub
The 'value' argument is always an array of the same type as 'type'. How can I loop through the values of the array?
I'd like to be able to do something like this:
DoStuff(GetType(Integer), New Integer(){1,2,3})
Public Sub DoStuff(ByV...
Some predefined methods contain a ParamArray in their signature.
Delegates, however, cannot contain a ParamArray in their signature.
Question: Assume you wish to create a delegation mechanism for a specific method which requires a ParamArray. How would you work around this constraint?
EDIT: just to make clear, assume you cannot change ...
Using the following code:
Private Sub MakeMeSomeXmlBeforeRyanGetsAngry()
Dim db As New MyDBDataContext
Dim customer = From c In db.Customers Select c
Dim dcs As New DataContractSerializer(GetType(Customer))
Dim sb As StringBuilder = New StringBuilder
Dim writer As XmlWriter = XmlWriter.Create(sb)
dcs.Writ...
I'm writing a standalone application in VB.NET using Visual Studio 2005.
I want to display/hide a bunch of Buttons based on the selected value of a ComboBox. Each selection would have a different set of Buttons to display, and I'd like to have them arranged in a nice grid.
Driving a TabControl with the ComboBox value would be the kind...
In CSS, we have a Property called z-index, what is the same in Winfrom set for a Panel control to the "Z-Index?
...
Hi, I believe this is a tough one...
I'm trying to create a collection of variable binding in a class.
It is intended to look something like this:
Dim x as integer, s as string
Dim c as new VBindClass
x = 1
s = "Hello"
c.Add x, s
Debug.Print c.value(x) '= 1
Debug.Print c.value(s) '= "Hello"
Is there some function that allow us to ...
I've some code on the net regarding retrieval of NetBIOSName (Pre-windows 2000 domain name) of an Active Directory Domain. Here's my code sample:
Me._rootDSE = New System.DirectoryServices.DirectoryEntry("GC://RootDSE", "", "")
Dim results As System.DirectoryServices.SearchResultCollection = Nothing
Dim ADSPath As String = "...
This is the code for my array (which is working)
Public numUsers As Integer
Public fNameUsers As String = ("..\..\..\users.txt")
Public UserRecords As Usersclass() 'note... this line is in a module '
reader = New System.IO.StreamReader(fNameUsers)
numUsers = 0
'Split the array up at each delimiter of "," and add new objects '
...
Hi!
I have CheckedListBox, now i want to put image from the ImageList next to the every checkbox.
I try to do that with this:
CheckedListBox1.Items.Add(ImageList1.Images(0))
But with this I get only checkbox with text System.Drawing.Bitmap!
What I am doing wrong, I and how i can put image next to the checkbox?
Thanks!
...
Hi:
I am using mysettings to save user settings.
This config file is saved in this path:
c:\ Documents and
Settings \ \ [Local
Settings] Application
Data\\\
Is possible to change this path? For example, in my case I save app data in "ProgramData" folder (Vista & W7) and I would like save this config file in the same folder...
Hi All,
Iam creating a Report with Nested Repeaters.
so far i have achieved, populating the nested repeaters with the whole database.
Populate Nested Repeater w.r.t the entered textbox value from datanase in asp.net vb
I have 2 Textboxes which takes from_date and to_date.
Now i want to populate the nested repeaters only w.r.t the dat...
I have a ListView control set up in details mode with 5 columns. It is populated by code using the following subroutine:
For j = 0 To 14
cmd = New OleDbCommand("SELECT TeacherName, ClassSubject, BookingDate, BookingPeriod FROM " & SchemaTable.Rows(i)!TABLE_NAME.ToString() & " WHERE (((BookingDate)=" & Chr(34)...
Is there a simple way of tracking the change of an Mdi's children i.e. when they are created and closed, something like an event OnMdiChildListChanged (I realise this doesn't actually exist).
I am also aware that I could have a method within my Mdi that handles the creation of child forms and logs the state of them or even create an Int...
Hi:
I have a Report Service running as a web service. I call the web service to get the RDL back as a byte(),
then I call XmlSerializer to cast it to a "Report" type autogenerated by the report service
The following code works just fine for SQL2005, but it would throw and exception for SQL2008, when tries to deserialize so if the report...
Hi!
I just trying to made word add-ins that gone save opened document.I made ribbon and button on it.Below is the that i use for saving word document on certain location:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As Microsoft.Office.Tools.Ribbon.RibbonControlEventArgs) Handles Button1.Click
Dim ThisApplic...
Suppose one has a number of databases -- 20 or more. Many seperate "workflows" of homogenous ASP.NET WebForms are used to provide a way for users to either insert or retrieve records from the databases. The forms are linked by a central user base and permissions model (which is not necessarily a factor in this question.) Very little "...
What advantage is there, if any, to using Modules rather than classes in VB? How do they differ, and what advantages/disadvantages are there in using modules? In VB or VB.NET, I use both.
...
I am not sure about the semantic of "ApplicationDirectory" membership condition.
I am trying to use it in the .NET Framework 2.0 configuration tool. The tool's explanation to it is as below:
The Application Directory membership
condition is true for all assemblies
in the same directory or in a child
directory of the running a...
I get this error "Illegal characters in path" for this code:
Dim strm As System.IO.FileStream
strm = New System.IO.FileStream(filepath, IO.FileMode.Open, IO.FileAccess.Read)
...
I have an ASP.NET MVC project that works fine on my local machine (no build errors, server errors or anything). However, when I publish the project to a test server, I get an "Object reference not set to an instance of an object" error on a For Each I have in my view.
I have a function within a model that returns a DataRowCollection. I'...