vb.net

Migration of a VB6 application

Migation of a VB6 application to .NET platform is almost like a rewrite, no matter it is VB.NET or C#. Do you think it will require more effort to do it in Java platform, when compared to .NET platform, since it is a rewrite anyway? Please share your thoughts! ...

Using A Local file path in a Streamwriter object ASP.Net

I am trying to create a csv file of some data. I have wrote a function that successfully does this.... Private Sub CreateCSVFile(ByVal dt As DataTable, ByVal strFilePath As String) Dim sw As New StreamWriter(strFilePath, False) ''# First we will write the headers. ''#DataTable dt = m_dsProducts.Tables[0]; ...

Control button Post Back when click it in ASP.NET with VB.NET

In my Default.aspx web page i use the following code in order to save some Attributes to an xml file <asp:Button ID="Button1" Text="Save Attributes" CssClass="Button01" runat="server" OnClientClick="SaveAttributesButton_Click(); return, false;" > </asp:Button> when i Click on the button is making post back I...

Undetermined type conversion in VB.NET 2008

I figured this would be a quick google, but extensive searching hasnt yielded any results. Everything about type conversion seems to dance around this concept. I want to get the type of variable "a", and make a new variable named "b" of that type. Otherwise I could have "a" as a type already declared and "b" simply as an Object, then tr...

get last 5 character vb.net

i want to get the last 5 digits/strings from a strings of words. eg: "I will be going to school in 2011!" i am using visual studio.net 2008 and using vb.net. i will like to get "2011!" note, my strings changes, and the last 5 characters can be anything! any ideas. i know visual basic have Right(string, 5); this didn't work for me ga...

Regex problem ...

hello i have the next regex Dim origen As String = " /c /p:""c:\mis doc umentos\mis imagenes construida\archivo.txt"" /cid:45 423 /z:65 /a:23 /m:39 /t:45rt " Dim str As String = "(^|\s)/p:""\w:(\\(\w+[\s]*\w+)+)+\\\w+.\w+""(\s|$)" Dim ar As Integer Dim getfile As New Regex(str) Dim mgetfile As MatchCollection = getfile.Matches(o...

Help understanding .NET delegates, events, and eventhandlers

Hello, In the last couple of days I asked a couple of questions about delegates HERE and HERE. I confess...I don't really understand delegates. And I REALLY REALLY REALLY want to understand and master them. (I can define them--type safe function pointers--but since I have little experience with C type languages it is not really helpfu...

How to subtract dates in YYYYMMDD format?

I have 2 integer fields that represent dates in the YYYYMMDD format. What is the best way to subtract 2 of these fields to get the correct # of days between them? For instance, if I take the difference between 20100511 and 20100428 I would like the result to be 13 and not 83. I know I need to convert the integer fields into date forma...

Updating a Row in a DataTable crashes IIS app Pool.

I have some very simple code that is used to Import data from various files in my database via a .net web application. During my recent updating of this code to make some centralise function calls I ran into a situation where I try to Add a data row to a data table and this crashes or better yet restart the applicaton pool. I noticed tha...

how to know when a work in a thread is complete?

I need to create multiple threads when a button is clicked and i've done that with this: Dim myThread As New Threading.Thread(AddressOf getFile) myThread.IsBackground = True myThread.Start() but i need to update a picture box with the downloaded file, buy if i set an event in the function getFile and raise it to notify that the files ...

Get a random character from a string.

I need to get a random character out of a string. Thanks. ...

LINQ Query based on user preferences

How can I do this better (so it actually works : ) I have a LINQ Query that includes an order by that is based on a user preference. The user can decide if they would like the results ordered asc or desc. If fuserclass.SortOrder = "Ascending" Then Dim mydat = (From c In dc.ITRS Order By c.Date Ascending Select c) Else Dim mydat ...

How to create user properties in a dotnetnuke module?

Hello, I want to create user properties in a dotnetnuke module. I know I can create them manually in Admin->User Account. But I want to create them in my module so the user of the module needs not to create them manually. ...

VB.NET take each letter of a word and display in ListBox

Private Sub btnWord_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnWord.Click Dim Inputter As String Dim Words As String = "" Do Inputter = InputBox("Enter word", "Enter Word") If Inputter <> String.Empty Then lstDisplay.Items.Add(Inputter) Word += Inputt...

Can't create a Collection of Inherited Classes

Maybe I just don't know what to search for, but I'm going a little bonkers here trying to figure out how to create a collection of inherited classes. The base class, I will never use. Basically, I have 3 components: A base class call ImageFormat Child classes of ImageForm Code in Sub Main() to loop create a collection and loop through...

Add / Remove the default documents of IIS7 using vb.net 2.0 windows application

Hai, I wrote the coding for add / remove the default documents of IIS7 in vb.net 2.0 windows application using Microsoft.Web.Administration.dll. The coding is working fine. After adding a new document, the messagebox showing that newly added document name. Simillarly if I remove any document, the messagebox not showing that document nam...

vb.net -- Using arraylist as key in dictionary

Dim dct As New Dictionary(Of ArrayList, ArrayList) ' Populate Dictionary dct.Add(New ArrayList({"Dot", "0"}), New ArrayList({20, 30, 40,> 50})) dct.Add(New ArrayList({"Dot", "1"}), New ArrayList({120, 130, 140,> 150})) ' Search in dictionary Dim al As New ArrayList({"Dot", "2"}) If dct.ContainsKey(al) Then ' does not work****...

Sending an integer to COM1 using SerialPort

I'm having difficulty sending an integer to a serial port... I'm trying stuff like this, which run fine but I'm not picking anything up at the port. Private Sub fireToPort() Dim sPort As New SerialPort("COM1", 56000, Parity.None, 8, StopBits.One) sPort.Open() sPort.Write(New Byte() {Hex(1), 255}, 0, 0) sPort.Close() End ...

Excel - referenced values via OleDB from .Net client

I'm trying to read an Excel file (.xls, I think Excel 2003 compatible) via OleDB, but it fails to get the values for referenced fields. This is my current test code (please note, this is just part of the class): Private m_conn As OleDbConnection Public Sub New(ByVal fileName As String) Dim connString As String = String.Format("Pro...

getting the heading of a selected text in word

Hi, I am working With Microsoft Word VBA,macros,.net My question : Is there way to get sub-topic and master-topic that precedes a selected body text ? Here is an example: Master topic (level 1) sub-topic 1 (level 2) body text a body text b body text c sub-topic 2 (level 2) body text d body text e Other MISC topics (level 2) bo...