vb.net

VB.NET IsNot for string comparison

If Object.Value IsNot "Something" Then Can you do this, or are there certain cases in which it wouldn't work? Wasn't sure if this should only be used for integers and booleans. Thanks! ...

NLog not Logging in Simple App

Hi, I am trying to implement a simple log using Nlog 1.0, using the following code Dim _logger = LogManager.GetCurrentClassLogger() _logger.Debug("Iain") And the following NLog.config. <?xml version="1.0" encoding="utf-8" ?> <nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-in...

VB.NET - How to grab echo messages from PHP?

Hey, I'm currently coding a client, how would I fetch PHP errors on the Vb.net side of it? E.g. PHP echo 'Server offline';, how would VB.NET fetch that and stop whatever its doing? ...

Double-click DataGridView row?

I am using vb.net and DataGridView on a winform. When a user double-clicks on a row I want to do something with this row. But how can I know whether user clicked on a row or just anywhere in the grid? If I use DataGridView.CurrentRow then if a row is selected and user clicked anywhere on the grid the current row will show the selected...

VBCodeProvider.CreateParser() returns Nothing?

Here is my code Dim provider = New Microsoft.VisualBasic.VBCodeProvider() Dim parser = provider.CreateParser() parser is always Nothing. I know the Method CreateParser is obsoleted. How to create a VB code parser? Thanks! ...

Data Migration : What way is the best way to Migrate?

hi All, I am doing data migration two database in MS SQL 2005. The records are more than 200000 nearly 300000. I need to query from source database using joins and insert 2 or 3 tables in destination databse. Which way is the best way to do so? Please suggest me. I am trying to write a program with VB.NET. If you have sample, please sh...

What is the appname.vchost.exe file.

Hi everyone, Every time I build my .NET application with Visual Studio, I got a appname.vchost.exe file along with my appname.exe file. This file doesn't exist when I build with command line commands. So, What is this *.vchost.exe file for? Could someone explain its working mechanism in detail? Thanks. ...

How to get the string from an address specified by a long in VB

In vba, There is an address held by a long type which points to a null-terminated string, but I can't find a way to get the string from this address: long str_address = ... string str = ? Would you please shed some light on this? ...

Show child Windows form in the status bar of the parent window

In my project i have one parent window form with one menu bar and one status bar. that is what i want is: when i show the child form to see in the status ber an icon relative to the child window. How i can do that? And if that can't be how i can see an icon in a task bar? Please if anyone can assist me on this. ...

StreamReader - Reading from lines

I have the following code; Public Sub writetofile() ' 1: Append playername Using writer As StreamWriter = New StreamWriter("highscores.txt", True) writer.WriteLine(PlayerName) End Using ' 2: Append score Using writer As StreamWriter = New StreamWriter("highscores.txt", True) writer.WriteLine(Score) ...

Compact Framework compilation problem

Hey all, I'm brand new to Compact Framework and I need to compile a small project for a Windows CE 6.0 device (on which I already installed CF 3.5). I'm using Visual Studio 2005. When creating a new project like : "Other languages -> Visual Basic -> SmartDevice -> Windows CE 5.0", I can compile a simple form, put it on my mobile device...

Making State abbreviations from State Names

Is there built in .NET functionality for making state abbreviations out of state names? I know the function wouldn't be difficult to write, but I would assume that MS has thought of a more efficient way than the following x50: if statename.tolower = "new york" then statename = "NY" else if any other thoughts of making this more e...

Determining if a type is a reference type or value type

I've come from a Assembler and C/C++ background, so I understand the concept behind reference types versus value types in vb.net. Also, I've read Jon Skeet's article regarding references and value types and I understand all of that. My question is: How can you tell if a given type is a reference type or a value type? Is it simply t...

Strange COM behaviour called from .net

i am working on an application which calls the COM component of a partner's application. Ours is .Net, theirs isn't. I don't know much about COM; I know that the component we're calling is late-bound i.e. obj As Object = CreateObject("THIRDPARTY.ThirdPartyObject") We then call a method on this COM object (Option Strict Off in the head ...

asp.net/sql get everything in the string before the "-" and put it into a different string

Basically I have got two things i am passing from a command argument <asp:LinkButton ID="lbEditDetails" Text="Edit..." runat="server" CommandName="EditDetails" CssClass="EditAdults" CommandArgument=<%# DataBinder.Eval(Container.DataItem, "number_slept") & "-" & DataBinder.Eval(Container.DataItem, "booking_ref") %>></asp:LinkButton> I...

ObjectContext items collection is empty in COM+ Component

Hi all, I have ported a COM+ written in VB 6.0 to run in ASP.NET 3.5 and am attempting to debug locally -- My client is an ASP.NET application-- the target client will actually be a classic ASP application, but we aren't allowed to run IIS on our development machines, so I'm just trying to get the code to work with ASP.NET for now. Wh...

MS SQL Server, indicating VARBINARY(MAX) field's datatype in VB.NET

So, I have this scenario where I use a VARBINARY(MAX) column, because I have no idea what is going to be put into it. All I know is that as of this point in time, the data will be one of many traditional data types(Integer, String, DateTime, etc.) I also have another column that is meant to indicate the DataType so the .NET application ...

iterate all properties in the list

I have List (Of Report). Report has 90 properties. I dont want write them each and every propertiy to get values for properties. Is there any waht to get propeties values from the List Ex: Dim mReports as new List(Of Reports) mReport = GetReports() For each mReport as Report In mReports 'Here I want get all properties values witho...

ASP.NET Is there a way to add two "OnItemCommand" to my asp:repeater

I have two button with different commands <asp:LinkButton ID="lbEditDetails" Text="Edit..." runat="server" CommandName="EditDetails" CssClass="EditAdults" CommandArgument=<%# DataBinder.Eval(Container.DataItem, "number_slept") & "-" & DataBinder.Eval(Container.DataItem, "booking_ref") %>></asp:LinkButton> <asp:LinkButton ID="lbSubmitD...

VB.NET - Calling Kernel32.DLL's Wow64DisableWow64FsRedirection.

Looking at Microsoft's page on Wow64DisableWow64FsRedirection, I see some C code. What if you want to call this function and it's revert from VB.net? So far I have done this: <Runtime.InteropServices.DllImport("KERNEL32.DLL", EntryPoint:="Wow64DisableWow64FsRedirection")> _ Public Shared Function DisableWow64Redirection() As Boolean...