vb.net

Overriding System.Diagnostics.Trace.WriteLine to log to a file

This may be more of an OOP concept question, but here's what I'd like to do. I have an application that outputs debug information using System.Diagnostics.Trace.WriteLine so it can be viewed with DebugView. I'd like to override/extend (not sure of the proper terminology) this method to log the text to a file instead, or maybe in additi...

Copy to excel from VB.Net app causes a 0x800A03EC error in some environments.

Here is the error: System.Runtime.InteropServices.COMException, Paste, Exception from HRESULT: 0x800A03EC All machines are Windows XP with the same version of Excel (2003). Some machines get the error, some don't. We have yet to find a pattern. Here is the code: Public Shared Sub ExportToExcel(ByVal dt As System.Data.DataTable) ...

Simplest way to send messages between Matlab, VB6 and VB.NET programs

We are upgrading a suite of data acquisition and analysis routines from VB6 programs to a mixture of VB.NET, VB6, and Matlab programs. We want to keep the system modular (separate EXEs) so we can easily create specialized stand-alone analysis programs without having to constantly upgrade one massive application. We have used MBInterPro...

problem in generating PDF in VB.NET 2005

I am having a problem while generating a PDF doc, the text which I want to show in the PDF doc axceeds the PDF paper range. So how can I adjust the text to fit the page range. please help me ,any one ... updates: this is a sample of my code that shows some questions and answers; Dim PDF As PDFCreatorPilotLib.PDFDocument3 ' crea...

How to get unique First Letter of names and count of names starting with that letter from SQL Server using LINQ?

Hello all. I was playing with ASP.NET MVC 1.0 a couple of days ago. I started out with a single table DB named 'Contacts', with very simple structure e.g. Title, FullName, SurName, Email, Phone, Address etc. I'm using LINQ as my Model. In my main view I wanted to display a list of alphabets that have matching FullNames starting with t...

How to select only Date value No Time in LINQ to SQL?

I need to have a query which list all the user according to the date value in the database. Problems is this, in the database the date format is 5/5/2009 4:30:12 but I want to compare with 5/5/2009. I think the value of the based date is 5/5/2009 12:00:00 and that's why I couldn't query it. The query is something like dim db = new dat...

.net - How to use attributes and including arguments?

Hi, I'm writing a class-library in VB.Net and one of the subs that are being called from the application which is using my library has more or less the following syntax: Public Sub LoadDict(ByVal PhoneticType As String, ByVal strDict As String) where PhoneticType can be phonSoundex, phonDoubleMetaphone or noPhonetic I want to give t...

Visual Basic - How do I store strings permanently? After the app is closed?

Hi, I'm trying to figure out how to do this as I'm not sure what's the proper way of doing this. I've got several strings that I want to store/save permanently, even after the application is closed. How should I proceed? Do I read or write from a textfile? ...

Performance of Dictionary(Of String, SomeReferenceType) in VB.NET

How does performance for reading/adding values from/to Dictionary(Of String, SomeReferenceType) depend on the number of records already entered? I mean, does time increase as O(1), O(log n), O(n) when n goes to be large, or in some other way? Dim index As New Dictionary(Of String, SomeReferenceType) ' N entries added in a loop ' ... D...

Can I implement yield return for IEnumerable functions in VB.NET?

In C#, when writing a function that returns an IEnumerble<>, you can use yield return to return a single item of the enumeration and yield break; to signify no remaining items. What is the VB.NET syntax for doing the same thing? An example from the NerdDinner code: public IEnumerable<RuleViolation> GetRuleViolations() { if (String...

How to display Duration only Hours:Minutes:Second in Gridview Asp.Net by using LINQ to SQL?

Hi again Guys, I want to display the duration only Hour, Minutes, and Second in data Gridview by Subtract TimeCheckOut from TimeCheckIn in ASP.NET using LINQ to SQL Here is code behind: Dim db = new MyDataContext Dim user = from u in db.Employees select IDNumber = u.IDNumber, _ FirstName = u.firstName, LastName = u.lastName,...

Drag & Drop in VB/ASP Using Controls Created During Runtime

Hello all, This is my first time posting on Stackoverflow, but I've been reading through many questions & answers for a couple months now! Now, I'm stuck and I desperately need help. Background info: Site is located at http://www.mobiuspc.com and the section in question is the "configurator" button on my top row navigation. Everything...

Mining out functions from a CPP file

Hi experts, I am using Visual Studio 2005, VB. I have to parse a CPP file and list all the functions that are getting called in that CPP file. Is there any built-in object that can make things easier for me or should i go about searching for () and then finding out the function calls? That is also a bit difficult (I suppose) because the...

VB.NET Extension Method in View using ASP.NET MVC

I ran into a strange issue over the weekend while I was working on an asp.net mvc project in vb.net. I created an extension method to convert an integer to the corresponding month it is associated with. I tested the extension method in a console application so I know it is working. In my asp.net mvc project I have a view and want to...

Linq - Excluding items from different list types.

Is there any way to select items in a list that aren't contained in another? For example: list1 = From t In list1 Where Not list2.Contains(t.column1) That gives me the error: Value of type 'Integer' cannot be converted to '<anonymous type>' which makes sense, since list2.Contains is expecting the same type as list2. However, the li...

SSRS: How to count true rows

I have a report with a dataset that has a column with booleans. In the table footer I want to display x / y where x is how many rows that were true and y is how many rows there was total. Currently I have this: =Count(Fields!Transfered.Value).ToString() + " / " + CountRows().ToString() But the first becomes same as the last part. I t...

VB Syntax to declare a single model in MVC (to leverage strongly typed views)

I'm trying to avoid the use of magic strings as much as I can, but I can't find the correct syntax for VB to bind a single model like is shown in this c# example. Can anyone point me in the right direction? (currently the below says "expected end of statement" under the Model text) <% Dim FormObject As Form = (Form)Model %> EDIT: A...

Is it possible to fire off another button's onclientclick event??

I have a modal popup that has a targetId to a hidden button. I want the popup to occur when a button in a grid is clicked but that button is programmed behind the code and therefore the targetId would be invalid... So I wanted to attempt to set the gridview's button's onclientclick event to be the onclientclickevent of that hidden butto...

Block context menu on OpenFileDialog

Is it possible to programatically block users for accesing the context menu on files listed after showing an openfiledialog control that comes with the .net framework? The intent is to block them from accessing "open" or "open with" and only allow them to pick a file from the list. My only other idea is to build my own control instead ...

.netCART Credit Card Decryption - IIS 7 App Pool and Decryption issue

I've got a site using .netCART. It's running fine in production with Windows Server 2003 and .NET 2.0. On the new server (Windows Server 2008) everything is working except for credit card decryption in the store admin. No errors are being sent, no exceptions thrown, just the encrypted string being output to the screen instead of a decryp...