vb.net

vb.net handle a post with an array

Hello All, I'm trying read an array that was post from a html form <input name="test[]" id="1" type="checkbox" value="1" /> <input name="test[]" id="2" type="checkbox" value="2" /> <input name="test[]" id="3" type="checkbox" value="3" /> <input name="test[]" id="4" type="checkbox" value="4" /> In php I know you can just access the da...

How do I trim a log file with vb.net?

I'm writing a simple application in vb.net and need to output some information to a log file for diagnostic purposes. In order to ensure that the log file doesn't get too big, I need to trim it to a certain number of lines (say 5000). For performance reasons, the trimming doesn't have to occur each time a log entry is written out nor is...

How to make arrays of button in vb .net 2005

hi there :) i just want to ask on how to make an array of buttons in vb .net 2005. It seems very different in vb6 'coz in vb6 you have just to add an index on its property but in vb.net there is no index property. Can it be made by designing in on the form just like copying and pasting on the form in vb6? ...

Converting SQLDataReader to String in VB.Net

I am returning one row from the database, and I want to convert the SQLDataReader to a string format, so I can pass it to my webservice. Dim rdr As SqlDataReader = sqlcmd.ExecuteReader If rdr.HasRows Then rdr.Read() GetInvHeaderValue = Convert.ToString(rdr.Read()) Return GetInvHeade...

Is there a Mac alternative to Visual Studio Express?

I've just started programming in VB.Net and don't want to use Dreamweaver to do it all. I use a Mac for all my other work like design work and coding in Dreamweaver but would like to know if there is an alternative to Visual Studio Express so that I can do all my vb.net stuff on the mac too. Any suggestions? ...

Is is possible to migrate away from VB.Net towards C# for use with Mac

I have just started programming and have taken over someone else's work and they did everything in VB.Net. How hard would it be to migrate away from VB.Net - all our pages are coded in VB but i'd like to learn C# and then move forward with that. I use a Mac so it's seems easier for C# to work properly on a Mac ...

Disabling an html img control in a VB.NET code behind file

How do i hide an html img from a code behind file in VB.NET? The img tag doesnt have a runat attribute and hence not a server control. I tried Dim cs As ClientScriptManager = Page.ClientScript cs.RegisterStartupScript(Me.GetType(), "alert", "alert('test')") in the Page_Load(). But doest work. I want to access the id using javascript ...

vb.net traversal

rs.Open "select * from applicationdetailstable", con, adOpenDynamic, adLockOptimistic If rs.BOF = False Then disp End If End Sub Sub disp() Text1.Text = rs.Fields(1) Text2.Text = rs.Fields(2) End Sub Private Sub Command1_Click() ' Move First rs.MoveFirst disp End Sub Private Sub Command2_Click() ' Move Pre...

VB.NET Extension on Nullable(Of T) object, gives type error

The code I want to work: <Extension()> Public Function NValue(Of T)(ByVal value As Nullable(Of T), ByVal DefaultValue As T) As T Return If(value.HasValue, value.Value, DefaultValue) End Function So basically what I want it to do, is to give along a default value to a nullable object, and depending on if it's null or not, it will g...

Add new Records to GridView but DB should not be updated

i'm having a gridview which is binded to a dataview, OnPageLoad i'm populating gridview records. and i have a textbox and a button, So now i want to add more Records to GridView but this records should not be get added into DB, they just added to the page and of course the default records which are coming from db stay. <asp:GridView id=...

Issue with returning records back to a web service

I am having some issues in attempting to display a recordset from my webservice. Currently my application involves a client feeding their values into my webservice. The webservice will then call a vb.net database class, which executes a SQL stored procedure, returns a recordset to the database class, and the class will pass the record...

Extended With-keyword in VB.NET

In my current project everyone names variables and methods after what they are and what they do. This is good for quickly understanding the code, but with a lot of long varible names comes some headaches, such as when copying a dataset to an entity/object. So, while you understand the code, the readability still takes a blow. veryLongVa...

Need a working example of a C# class used in VB.NET

Could anyone please give me a short working example of a C# class which can be compiled to a DLL, and an example of VB.NET-code creating an object based on this class and using its members (methods). The C# class has to have a namespace, at least one class definition (obviously) and some methods or whatever they ought to be called. I hav...

VB.NET Creating dynamic control events..

Hello I am using Infragistics tools in my application. Here I am using a web panel which has a details view, text boxes,buttons and a couple of list boxes and all the above are created dynamically in a repeater control. The items in one listbox are moved on to the next listbox when i click a dynamic button which has id btnNavi. When i...

What kind of handheld device/OS to use to interface with a Win Forms/ SQL Server Express App?

I'm currently working on an VB.net application using Win forms and SQL Server Express 2008. One of the major functions of our program is to generate work orders for field engineers. These engineers typically work in a factory and have to walk around the factory to complete these work orders doing things such as recording pressures and vo...

Exit button, without saving to database when items have already been added

I do not have any code to show, but using asp.net, vb.net, and SQL with stored procedures. If on a page I have an item that is added to the database and therefore that information is "saved", is there a way to have an ("exit without saving") button on the page that does away with those changes? Using infragisitcs ultrawebgrid, you add ...

Can a Visual Basic (.NET / 2010) file be split up for readability?

I'm writing a program in Visual Basic 2010. It's a HMI (Human-Machine Interface) and therefore has a whole whack of buttons that just send commands to other devices. As a result, there are a huge pile of event handlers for clicking buttons that can't really be broken down into modules (unless my understanding of modules is wrong). Essen...

VB.Net - "With" and Closures don't mix

Just thought I'd share this in case anyone else has run into this. I did something similar today and it took me a while to figure out why this was causing a problem at runtime. This code: Public Class foo Public bar As String = "blah" End Class Public Sub DoInline() Dim o As New foo Dim f As Func(Of String) With o f = Func...

Using MS Access database as a file format for desktop application needing open / save type functionality

Hello! This is probably a pretty novice design question. I'm trying to work my way through a number of requirements and give the users the experience they're looking for... I've written a tool that does big calcluation-type things. It currently consists of a class library and command line tool (separate .NET projects.) We're using an...

Binding a Dictionary(Of Integer, String) to the DataTextField property of a DropDownList

I have a State class defined like this: Public Class State Public Property StateId As Integer Public Property Name As Dictionary(Of Integer, String) End Class Name(x) contains the state name in different languages. I get a collection of State from the method StateManager.GetAllStates() and I want to bind this collection to a...