Basically, I have a function that has an optional dictionary argument. Since it's optional, it needs a default value, and I'd like to set it to an empty dictionary instead of Nothing. How do I go about that?
In Java, I would simply do this:
Collections.<K,V>emptyMap()
How do I do the equivalent in VB.NET?
(I'm using .NET 3.5).
...
How do I exclude one value from a grouping sum, based on a value of another field?
ie I open Report=> Report Properties=>Code and insert my Custom Code, but how would I change the below code to exclude a numeric value of another field for the below case?
Public Function ChangeWord(ByVal s As String) As String
Dim strBuilder As New ...
I am allowing users of the admin panel of my website to upload photos, its a simple process where I check the validity of the image and then save it to a folder, then I also have to record a couple of database records for that image to be able to retrieve it later, my saving function is as follows...
The function that uploads and saves t...
Hi,
I want to maintain a list of potential ComboBox values over multiple executions of my program, and to use that list as the DataSource on multiple ComboBoxes.
I also want changes made to the DataSource to propagate over all of the ComboBoxes already existing in the application.
Can someone recommend what type of object I should use a...
I used something like
Dim i As String
i = Server.MapPath("~/photos/") + fileName
Only once in a project that was working and online, on the offline version, when I run it on my machine, its working, no errors, I uploaded it, it gave me an error like:
'~/photos/http://www.MyURL.com/photos/4411568359267Pic003.jpg' is not a...
My end result is that I want to launch another setup project after the first setup project closes. The problem is that since setup.exe is just a wrapper for the msi package. WaitForExit is quitting when the setup.exe is finished and not foo.msi.
Using Process As New System.Diagnostics.Process
Process.StartInfo.FileName = "setup....
Can someone explain the difference?
...
I have a sql data source and I have a really long string of SQL. I want to put linebreaks in my sql but Visual Studio doesn't seem to like the linebreaks. How would I put in line breaks?
Example
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ProviderName="System.Data.SqlClient"
SelectCommand="select aci...
I need to export data into an Access database. My code works, but it works with the assumption the client machine has the Microsoft.Jet.OLEDB.4.0 as a valid provider.
I want to test to see if this is true or not, in code. My problem is that I don't have the location of an existing access database and I don't want to create a new .mdb ...
Does anyone have an extension method to quickly convert the types in a LinkedList<T> using a Converter<TInput, TOutput>?
I'm a bit surprised, where is the ConvertAll<TOutput>(delegate)?
...
I have a stand-alone WinForms application, let's call it "Program A." Program A let's a user create a file and save some information to it. Program A also exposes some public classes.
Another stand-alone WinForms application ("Program B") references Program A, and uses some of its public classes.
However, some of Program A's classes n...
I'm trying to upload a file in VB.NET using an HtmlInputFile, but everytime I upload, the HtmlInputFile's PostedFile is Nothing.
Here is my ASP.NET code:
<form id="Form1" method="post" runat="server" enctype="multipart/form-data">
<asp:DataGrid id="dgTitles" runat="server" OnUpdateCommand="dgUpdate" DataKeyField="ID">
...
I am writing a library in VB.NET in which I have added, among others, a class originally written in C# but converted into VB.NET. I don't know much about C# so therefore I have used online C# to VB.NET-converters. Now I am stuck with some code which I believe the online-converter was not able to "translate" properly.
When running the co...
Hi,
I'm trying to load an image that is in the root dir of my project:
Dim b As Bitmap = New Bitmap("img.bmp")
but it doesn't seem to find the file.
I've tried various combinations like ~img.gif, /img.gif, \img.gif, ~/img.gif etc, but none seems to work. How to access the "current directory on server" in ASP.NET?
Thanks
...
I'm populating a datagrid using Linq--standard kind of stuff (code below). For some reason however my ultraDataGrid is stuck in some kind of read-only mode. I've checked all the grid properties I can think of. Is that a result of binding to a Linq data source? Anyone have example code of an updatable grid that uses Linq?
db = New Data...
I have a text file that is in a comma separated format, delimited by " on most fields. I am trying to get that into something I can enumerate through (Generic Collection, for example). I don't have control over how the file is output nor the character it uses for the delimiter.
In this case, the fields are separated by a comma and tex...
Hello,
I'm having some problems updating the database using Linq...
Public Shared Function Save(ByRef appointment As MyLinq.Appointment, ByRef db As MyEntities) As Boolean
If appointment.id = 0 Then
db.AddToAppointments(appointment)
Else
db.AttachTo("Appointments", appointment)
'db....
Is it possible to start another EXE in Managed Code? At this time, all I can do is use:
System.Diagnostics.Process.Start(exeName)
Is there another way to call another EXE within the same project?
Thanks!
JFV
...
Solution
This is what I came up with:
Public Class IndexedDropDownItem
Private _KeyCode, _Display As String
Public Property KeyCode() As String
Get
Return _KeyCode
End Get
Set(ByVal value As String)
_KeyCode = value
End Set
End Property
Public Property Display() As...
String comes back from the database with a format: '00/00/0000' I need to then compare it to a date that the user has entered in the same format. How do I make the conversion and compare the two dates?
...