vb.net

Migrate from VB.net to C#

Hello Experts, I have been developing applications using VB.net for the past 5 years. As I tried to learn Java earlier and found it very difficult for me I did stick on to VB.net. And for me C# is more or less similar to Java. Now I cannot get away with it. I have to code on C#. Is there a way I can get to speed with C# fast. I would re...

VB.NET Incrementing Indexes

Hello, I am having trouble incrementing the indexes of my list item properties. Here is the code. Dim i As Integer = 0 For x As Integer = 1 To list.Count / 19 database.ExecuteCommand("INSERT INTO Contacts VALUES ('" + _ list.Item(i) + "', '" + _ ...

How is this input tag linking to another page?

Response.Write("<div><input type='submit' name='submit' value='Update Cart' /></div>") Response.Write("<div><input type='submit' name='submit' value='Shop More' /></div>") Response.Write("<div><input type='submit' name='submit' value='Checkout' /></div>") that is some example code from my teacher, but he hasn't answered my email in ...

My Lucene queries only ever find one hit

I'm getting started with Lucene.Net (stuck on version 2.3.1). I add sample documents with this: Dim indexWriter = New IndexWriter(indexDir, New Standard.StandardAnalyzer(), True) Dim doc = Document() doc.Add(New Field("Title", "foo", Field.Store.YES, Field.Index.TOKENIZED, Field.TermVector.NO)) doc.Add(New Field("Date",...

Versioning issues with assemblies

Let's assume I have two assemblies: MyExecutable.dll version 1.0.0 MyClassLibrary.dll version 1.0.0 Now, MyExecutable.dll currently uses MyClassLibrary.dll's classes and methods (which include some algorithms). Most of those algorithms were made on the run, being that later I'll want to refine them if needed. This means, I won't c...

How does the CLR know which if the given assembly is the correct one?

If we have a .NET executable that's using a .NET library, how does the CLR ensure you are using the correct version of the dll? CLRwise what is considered be the "correct dll version", to start with? Does it only look at the version? Looks also at the build-time(?). Maybe it looks at an hash or something? Thanks ...

VB.NET Use unload and close

Hi I want to know how to use the command close or would like some more info on because if you use this method Form2.Show frmMain.Close() the program is terminated and does not load the form2. Then when I close the program appears the message "hello world" vb6 enough to exploit the function Form_Unload, but in vb.net?? Thanks ...

Quicken like Windows Forms application

Hi All, I need to build a quicken like application, where data needs to be secure. I don't see any database being used by Quicken. I could use XML, MDF or Access database, but data is not secure in the tables. What is the best option? How does Quicken handle it? My application may also have document attachments as well. The functi...

Array length is zero in jQuery.

I wrote like this. After submit click loop is not excuting. But I saw value are there, But array lenght is showing '0'. (Please see picture). Why it is not going into loop? and $('#myVisibleRows').val(idsString); becoming 'empty'. $(document).ready(function() { $('tr[@class^=RegText]').hide().children('td'); var list_...

Alternative to Microsoft Agent / Fix for color issue?

I've got an app that does Text-To-Speech; but I wanted to show an animated face/character to go with it. I found a tutorial on Microsoft Agent and I implemented it in my vb.net app. The problem is with the transparency color. Unless I run application in compatibility mode/256 colors, the characters will appear with a purplish-pink b...

Can a function return an array?

Can a function return an array? ...

Set a project default for VB.NET projects so that the default Modifiers property for controls is Private

Is it possible to set a project default for VB.NET winforms projects so that the default Modifier for controls added to winforms is Private (not Friend)? I know there's a "modifiers" property in the properties window so I can set it for each individual control... however I would like to change the project so from now on myself and other...

Disable AND and OR keywords

In VB.net the ANDALSO and ORELSE keywords should basically always be prefered over the AND and OR keywords. What is the easiest way to disable the AND and OR keywords? I'm thinking FXCop (maybe somebody has already written this rule). Maybe just some setting in VS (we're currently using 2008 and are moving to 2010 end of the summer) I'm...

Tracing all events in VB.NET

I keep running into situations where I don't know what event I have to listen to in order to execute my code at the correct time. Is there any way to get a log of all events that is raised? Any way to filter that log based on what object raised the event? EDIT: Final solution: Private Sub WireAllEvents(ByVal obj As Object) Dim para...

VB.NET Get Publish Revision integer

How do I get my .NET Winforms app 2.0 to automatically update it's publish revision integer subsequent to issuing the publish command from within VS08. Trying to use the following C# as a guide object[] attrs = System.Reflection.Assembly.GetEntryAssembly().GetCustomAttributes(true); foreach (object o in attrs) ...

Cancel the calculation if input-mismatch was found

I have programmed a sub procedure that will be called in the main procedure (called by mainForm event), to validate the inputs before the main calculation. Now I'm searching for a way to cancel the calculation and refocus the mainForm if some inputs are mismatched. I think it's unnecessary to use the Try-Catch statement to trap the error...

Repeater with Multiple Type binding

Hi, I am in situation where I need to bind multiple types to a single repeater. Say for example I have 2 types in different namespaces abc.businessLayer.Type_A [properties - Name(string), Country(string)] xyz.businessLayer.Type_B [properties - FirstName(string), Location(string)] Now I need to bind the repeater with the combined re...

Hosting multiple WebBrowser controls in one window causes sessions to "cross": any solutions?

I have a Windows forms application written in VB.NET where I host multiple WebBrowser controls in the same window. The problem I'm having is that the session for each WebBrowser control seem to get "crossed" when making asynchronous requests, such as when loading images. For instance, I have WebBrowser1 that loads an HTML document and ...

How to check a SQL database table to see if a record exists

I have a SQL database that creates a record for every document uploaded by the user to the server. I want to check this table before a user uploads a document to ensure they don't upload a file with name that already exists. I know how to make the connection and make the SqlCommand to query the table for an existing record. But I don'...

Converting VB.NET code to C#

I have the follwing VB.NET code I am trying to convert to C#. Dim decryptedBytes(CInt(encryptedStream.Length - 1)) As Byte I tried this: int tempData = Convert.ToInt32(encryptedStream.Length - 1); Byte decryptedBytes; decryptedBytes = decryptedBytes[tempData]; But got this error message: Cannot apply indexing with [] to an expr...