Here I have:
Public Structure MyStruct
Public Name as String
Public Content as String
End Structure
Dim oStruct as MyStruct = New MyStruct()
oStruct.Name = ...
oStruct.Content = ...
Dim alList as ArrayList = new ArrayList()
alList.Add(oStruct)
I'd like to convert the ArrayList to a static strongly-typed Array of type MyStruct....
Could you please show me the C# Equivalent of this VB.NET code:
Public Partial Class Index
Inherits System.Web.Mvc.Viewpage(Of List(Of Task))
End Class
I am not sure where/how to add it in for C#:
public partial class DirList : System.Web.Mvc.ViewPage
{
}
The code is suppose to tell the class to expect a list of tasks from t...
I want to create a collection in VB.NET, but I only want it to accept objects of a certain type. For example, I want to create a class called "FooCollection" that acts like a collection in every way, but only accepts objects of type "Foo".
I thought I could do this using generics, using the following syntax:
Public Class FooCollect...
How do you create a database backup of a mysql database in VB.Net?
...
Is it better to have a field in the database that stores the customers account balance or use views and queries to generate the information.
...
I am hoping to find a way to do this in vb.net:
Say you have function call getPaint(Color). You want the call to be limited to the parameter values of (red,green,yellow). When they enter that parameter, the user is provided the available options, like how a boolean parameter functions.
Any ideas?
...
I have a legacy WinForms Mdi App in VB.Net 2.0 which I am adding functionality to. One of the additions is a warning which needs to be raised when the current time nears a specified value (a deadline). My intention is to check the time once an hour until there is less than an hour until the deadline, then display warnings at specified in...
I have a method that needs to accept an array of country names, and return a list of records that match one of those country names. I'm trying this
Public Shared Function GetConcessions(ByVal Countries As String()) As IEnumerable
Dim CountryList As String = Utility.JoinArray(Countries) ' turns string array into comma-separated stri...
I know the #warning directive does not exist in vb.net... is there anything like it?
I want to be able to throw messages (warnings) at compiler time.
...
I have a Windows forms project and a Web Service project in my solution, and I'm trying to call the web service and return a customer object as the result. The problem is that when I try to receive the return object, I get an error that it can't convert it. For example, here is the signature for my webservice:
Public Function GetDriverB...
So we are building an application with a
UI Layer (web, mobile, Ajax client, etc)
Service/API Layer
Business Logic Layer
Data Access Layer
Our goal is to have an Entity Framework dependency from the Service Layer on down to the DAL. That means the Sevice layer will only accept and return POCOs (plain old CLR objects).
What we're ...
I'm using the following code within the JCProperty class to retrieve data from a DAL:
Dim x As JCProperty
x = JCPropertyDB.GetProperty(PropertyID)
If Not x Is Nothing Then
Me.PropertyID = x.PropertyID
Me.AddressLine1 = x.AddressLine1
Me.AddressLine2 = x.AddressLine2
Me.A...
For the last year and a half we've gotten been working on a large WPF application and it's finally exiting beta and moving to full release. When we started the project, I fought hard for every assembly to use Option Strict. My team had little .NET experience prior to this project, and alot of experience with Visual Basic 5 where nearly e...
In a related question, my team is about to (hopefully) start using LINQ, and I'd like to take advantage of anonymous types. What is the best way to mix VB.NET's Option Strict (which we've been using through the life of the project) and the new Option Infer directives?
...
Hi,
What's the best way of adding spaces between strings
myString = string.Concat("a"," ","b")
or
myString = string.Concat("a",Chr(9),"b")
I am using stringbuilder to build an XML file and looking for something efficient.
Thanks
Edit ~ Language VB.NET
...
I'm working on an ASP.NET website where I am using an asp:repeater with paging done through a VB.NET code-behind file. I'm having trouble with the database connection though. As far as I can tell, the paging is working, but I can't get the data to be certain.
The database is a Microsoft Access database. The function that should be acces...
I am tryiing to create an "add to cart" button for each item that is displayed by an XSLT file. The button must be run at server (VB) and I need to pass parameters into the onlick, so that the requested item is added to the cart. Is this possible, and if so, how should I go about it?
When I try
<asp:Button id="Button123"
Text="Add t...
VB.NET has the "my" namespace, but how many VB.NET developers actually use it?
if you don't, why?
if you are using it, why?
I'm considering building a framework for VB.NET, and using the My namespace to plug it into VB seems like a reasonable idea. Is it?
...
Nightly, I need to fill a SQL Server 2005 table from an ODBC source with over 8 million records. Currently I am using an insert statement from linked server with syntax select similar to this:
Insert Into SQLStagingTable from Select * from OpenQuery(ODBCSource, 'Select * from SourceTable')
This is really inefficient and takes hours to...
My company has a large application written in VB6, and for historical reasons, the application is navigated with the Enter key instead of with the Tab key. I don't know VB6, but I know that they currently set the focus for each control in a big select statement in the Form's KeyUp event if it's an EnterKey. Now we are starting to conve...