We have a project for a client that is written in VB.NET. In one of the projects, we have about 100 modules, which are all VERY simple. They're extension methods that convert between object types. Here is a small snippet:
Public Module ScheduleExtensions
<System.Runtime.CompilerServices.Extension()> _
Public Function ToServicesData(ByV...
I have a requirement to move the html text available in a string builder to a word document and open the word document after the data is appended in a VB.NET console application. I am new to console applications and am not sure how this could be done, but I am aware that if I am using a Web Application then I can use the following code. ...
i have a control i created behind code
Dim txtdate1 As New TextBox
txtdate1.ID = "txtdate1"
cell.Controls.Add(txtdate1)
Cell is a header table cell i added to a gridview.
I need to access this in javascript
var txtdate1 = document.getElementById('txtdate1');
OR
var txtdate1 = document.getElementById('<%=txtdate1.clie...
I'm trying to set up logging with Microsoft's Enterprise Library (log4net seems to be a dead project). I'm using VB .NET 2008 and VS 2008. I've searched all over the MSDN documentation, CodePlex docs (including the Hands-On labs that installed and then vanished), and online tutorials to no avail.
They all refer to a mysterious "configur...
I'm trying to compute 100! and there doesn't seem to be a built-in factorial function. So, I've written:
Protected Sub ComputeFactorial(ByVal n As ULong)
Dim factorial As ULong = 1
Dim i As Integer
For i = 1 To n
factorial = factorial * i
Next
lblAnswer.Text = factorial
End Sub
...
Are there any disadvantages in performance by using the CallByName function in VB.NET? Is there any better way to do the call by Name in .NET 2.0 onwards.
...
I am working on a new domain model for an application that will have order processing for items built in (well, too keep it simple for this question anyway). I have a class "VendorItem" that represents items that can be ordered. Originally the "Order" class was going to have a list of VendorItems associated with it, but I have come acr...
How do you save an array or an arraylist in vb.net using My.Settings?
I cannot find the array type anywhere, even in the browse window.
I absolutely need to be able to save this.
I know I can convert the array to a string, but I do not know how to convert a string to an array. I know that if I were to break it at a delimiter then I c...
Given in the following language specification, for me at least, calling Db.Foobar() [In the following code] does not indeed call off to the Shared Constructors of the base classes. I am curious as to a) is this my own fault for doing something wrong or b) is this an error in the language specification
Public MustInherit Class D1
S...
I'm restating this problem to summarise what I've already found:
I have a test TypeConverter, (MyConverter), that for a ConvertToString will output "Converted To String", no matter what the input.
To ensure this is picked up by GetConverter for Int32, I add the following line:
(1) Dim tcp As TypeDescriptionProvider = TypeDescriptor.Ad...
In Microsoft Access there was an easy method to turn off screen updates by setting Echo = False. Is there an equivalent in VB.NET for WinForms? I've got a situation where I'm trying to prevent users from seeing controls flickering while they're being updated. I could probably solve the problem by coding it differently, but would rather a...
I am looking for one to use from my c# application. Anyone knows a free one?
...
Hello,
I am writing a winforms application and eventually I would like to write unit test for this application from the DAL, and Biz Objects layers etc.
Does someone know of a FREE tool that can recieve the path to an assembly and then output unit test stubs with matching signatures for the assembly.
Any configurable options like "pub...
I currently have a DataAccess Layer in Vb.Net. I am not too happy with my implementation of both my ExecuteQuery (as DataSet) and ExecuteNonQuery functions. Does anyone have any code that I could see? My code just doesn't look clean. Any thoughts or critiques on it would be appreciated also.
Using odpConn As OracleConnection = New Or...
I would like to create a textbox that accepts an ARGB value (Not a rgb value, an Argb value)
a.k.a allows semi-transparent background colors.
I have this in the designer code so far:
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class TransparentTextbox
Inherits System.Windows.Forms.TextBox
Publ...
if the code look like:
dim db = new context.mytable
db.somefield = something
context.insertonsubmit(db )
try
context.save
catch ex as exception
''----????
end try
how to I remove db from the context if it goes into the catch?
...
I have a matrix with rows indicating a name (Ex Store name) and I have data pertaining to that in the DATA cells. I also have another date field in this format (MM/DD/YYYY). I would like to use a cross tab between Store Names and Just the Month of the date field.
Jan Feb Mar Apr (From Date)
A (Store Name) 10 5 ...
Hey Guys,
Just wanted to get some ideas on what would be the best way to go about backing up and restoring part of my entity model. We basically have an entity model of our database, and would like to give the user the opportunity to backup sections of the database. Some things that have to be considered are as follows:
All tables hav...
The requirement:
On an error (thrown exception), the file being processed should be moved to the folder for files with errors (app.config setting).
The problem:
The only way that I can of handling this is to have a nested Try/Catch inside of the main Try/Catch to try to move the file, that way if the move fails, another exception is...
Hello SO:
I wrote an extension in VB.NET for StringBuilder to add a AppendFormattedLine method (so I would not have to use one of the arguments for a new line character):
Imports System.Runtime.CompilerServices
Public Module sbExtension
<Extension()> _
Public Sub AppendFormattedLine(ByVal oStr As System.Text.StringBuilder, _
...