vb.net

Event Signature in .NET -- Using a Strong Typed 'Sender'?

I fully realize that what I am proposing does not follow the .NET guidelines, and, therefore, is probably a poor idea for this reason alone. However, I would like to consider this from two possible perspectives: (1) Should I consider using this for my own development work, which is 100% for internal purposes. (2) Is this a concept that...

T4 Project Context in VB

How do I convert this to VB.NET?...I already tried running it through some online converters with no luck. Its one of the first lines in a T4 file... var dte = (DTE)((IServiceProvider)Host).GetService(typeof(SDTE)); Here is the VB that is spit out from on online converters: Dim dte As EnvDTE.DTE= DirectCast(DirectCast(Host, IServi...

Verifying if multiline textbox is visibly full.

Hi, I'm trying to make my own control in for .NET using VB and I'm having problems achieving what I want to do. In fact, I'm making a control which inherit from the textbox class and the only modification I'm trying to bring to it is that if the control is visibly full, the user can't type anymore. So: Scrollbars should never appear. T...

.NET 1.1 WSDL - Unable to use IntPtr (WindowsIdentity.Token) as input param on WebMethod (ASMX Web Service)

We're in a strange situation with a legacy winforms VB.NET 1.1 application using ASMX web services. Trying to send a user Token from a WindowsIdentity object as a parameter to a WebMethod. I will be adding a 'HACK: comment. System.Security.Principal.WindowsIdentity.GetCurrent().Token The token is of type IntPtr, the first problem is t...

Can I use the the power of Generics to solve my issue

I have a wierd issue. I am loading 1k invoice objects, header first then details in my DAL. I am using VB.NET on this project. I am able to get the invoice headers just fine. When I get to loading the details for each invoice I am getting a timeout on SQL Server. I increased the timeout to 5 minutes but still the same thing. If I reduce ...

Converting VB.NET code to VBScript

I have this snippet of VB.NET code that I want to convert to VBScript. It basically starts Microsoft Word, displays the Open dialog and mail merges the selected document. Any help will be highly appreciated. Dim oMissing As Object = System.Reflection.Missing.Value Dim oEndOfDoc As Object = "\\endofdoc" Dim oFalse As Object = False 'St...

Find control in Dataset

I have this code so I can grab the values ind the dataset before i bind it. can't get the dirctcast to work dim ds as new dataset("Mytable") gridView.DataSource = ds Dim dataRow As DataRowView = DirectCast(ds.Tables.Item("MyTable").Rows(), DataRowView) Dim ID_Equipamento As String = dataRow("ID_Equ...

Resize my image on upload not working - what must my buffer be?

This is the code i got from This Link I want the user to upload a picture and then resize it............. Public Sub ResizeFromStream(ByVal ImageSavePath As String, ByVal MaxSideSize As Integer, ByVal Buffer As System.IO.Stream) Dim intNewWidth As Integer Dim intNewHeight As Integer Dim imgInput As System.Drawing.Image = S...

implementing a trackbar that will change background color of form

i would like to have a trackbar on my form that will correspond to the HUE of the color of the backgruond, given a range of 1 to 360, and another trackbar that will correspond to saturation of the color of the backgruond, within a range of 1 to 50. ...

Preventing column auto sort after editing a bound DataGridView.

Hi I've got a DataGridView that has a DataTable as it's Datasource. Whenever I sort a column and then edit a cell, after editing the column, the column autosorts so the recently edited cell is no longer in the viewable area. Is there any way to prevent this auto sort from happening and only sort when I click on the columns? Many thanks ...

Visual Basic, Opening a file, what is wrong with my code?

Hi all, The 'reader' within the if statement is showing "Expression is not a method", what am I doing wrong? Thanks Dim reader As New CSVReader OpenFileDialog2.Filter = "CSV File (*.csv)|*.csv" OpenFileDialog2.RestoreDirectory = True If OpenFileDialog2.ShowDialog() = DialogResult.OK Then reader(O...

Create VS2008 Plug In with VB.Net ?

Anyone know of any examples on creating plug in's for VS2008 - preferably with VB.net? ...

LINQ to SQL architecture. What is best?

Hi all, This question is sort of a pool. We are trying to identify the best archtecture while using a ORM like LINQ to SQL. The archture we are defining is for sort of framework that other applications will access either trough directly referencing the DLL or through a webservice. We have .NET apps and PHP apps. The possibilities are: ...

Need a working example of a cascading drop down list written in vb.net

I Need a working example of a cascading drop down list box written in vb.net for my ASP.Net MVC application. I tried converting three examples written in C# but can't seem to figure it out and I have given up. The examples I have tried to convert are found here and here. This is my first .net application so I'm a newbie. The biggest ...

VB.NET: If I pass a String ByVal into a function but do not change the string, do I have one or two strings in memory?

I know strings are immutable, so the minute you change a string reference's value .NET makes a brand new string on the heap. But what if you don't change the value of a string reference; rather, you simply pass it into a function ByVal -- does this operation copy the string value on the heap as well? My inclination is "no," but I'd l...

Reading vCalendar and vCard using .NET?

I want to be able to read vCard and vCalendar data using .NET, I have something which does this, and have looked at the specification. For those not familar with the format here is some test data from my current application: BEGIN:VCALENDAR VERSION:2.0 PRODID:-//Microsoft Corporation//Windows Calendar 1.0//EN CALSCALE:GREGORIAN METHOD...

Catch, Handle, then Rethrow Exception?

I ran into an interesting dilemna today. I have a function that handles information and checks for duplicate values, then returns the next number that is not a duplicate. So, I have something like this: Public Function GetNextNonDuplicateNumber(NumberToCheck as Long) as Long //the non-duplicate the function will return Dim...

How does one receive and post text messages on a website, a la Twitter?

I've looked around at pretty much all the SMS posts here on SO and the best answer I've come up with so far is ZeepMobile. The only problem is, they're "in beta" and aren't readily accepting users. Is there a workaround for this, maybe receiving an email via text (kind of like how TwitPic does it?) somehow and parsing it? Basically all ...

Append html space algorithm

This question is along the lines of http://stackoverflow.com/questions/371088/html-table-horizontal-spacing We have an old code base and can not use css. When an entire column in a table is empty, the resulting table is very ugly. We have a text email solution that adds spaces to the end up a word up to the remaining set of characters...

How do I nicely display relative time using VB.NET?

I want to display a "date/time submitted" value much the same way as Stack Overflow does e.g.* 2 hours ago * 3 days ago * a month ago I see extensive answers on how to do this in PHP but can someone help me with the VB version? ...