vb.net

.NET Outlook Add-in: attaching a sent email item to a journal entry

So I'm developing an outlook add-in that basically gathers some info from the user in the form, then sends a properly formatted email to the right person. What I want to do is then make a journal entry noting that the email had been sent, and attach the email in reference. To accomplish this manually, I can go to the "Sent Items" folder...

Selecting a approximate values by using stored procedure

Using SQL Server 2005 and VB.Net Table1 ID Name Dept 001 Raja IT 002 Ravi CSE 003 Suns IT Stored Procedure Create Procedure Selecttable1 As Select ID, Name, Dept from table1 I want to execute the stored procedure with condition like cmd = new sqlcommand("Exec SelectTable1 where id like '" & idsearch.Text & "%' ", dbcon) cmd.Exe...

Could not Deserialize JSON Object

We are trying to consume WCF service which returns employee details in JSON Format. like: {"d":[{"_type":"Employee:#","BigThumbNailURI":null,"ID":1,"Name":"E1"},{"_type":"Employee:#","BigThumbNailURI":null,"ID":2,"Name":"E1"}]} From VB.net code behind when I am trying to deserialize it it's stating that "Expecting state 'Element'.. E...

ASP.NET Membership with two providers cant use GetAllUsers method

Hi, I'm using two membership providers. When I declared a following statement Dim allUsers As MembershipUserCollection = Membership.Providers("MembershipRoleManager").GetAllUsers Then, it gave me this error message. Argument not specified for paramenter 'totalRecords' of 'Public MustOverride Function GetAllUsers(pageIndex as Intege...

Best Object layout in ASP.net

What's the best object layout in ASP.net or at least.. what are the advantages and disadvantages of either case: Public Class Dog Public Breed as String Public Type as String Etc.... OR the use of properties and keeping variables private Somewhat of a debate among our team about it. Just wanted to hear tho...

C# to VB - How do I convert this anonymous method / lambda expression across?

How would you convert this to VB (using .NET 4.0 / VS2010) ? bw.DoWork += (o, args) => { Code Here }; I thought maybe like this: AddHandler bw.DoWork, Function(o, args) Code Here End Function But it says Function does not return a value on all code paths. Ideas? ...

C# usage in COM heavy application

I would like to use C# for an application I'm building, but the application makes heavy use of automation (i.e. Excel, Word). Is it feasible to use C# for such an application? It used to be a nightmare to use C type languages for things like parameter lists with null arguments etc.. What are some tips to make things easier or should I...

linq query where column contains null values

I have the following query Dim get_rmf_2 = From rmf In t_rmf _ Where rmf!NIVP = nivp_rap When i run it i get an error : Operator '=' is not defined for type 'DBNull' and string "test". I suspect this is because the column "NIVP" in the datatable contains null values, I've tried yhe same thing without null values and it works...

word document parsing after html conversion

I have used examples from threads here on how to open and convert word documents to html in order to parse them. I got it all working great using the office interop library but used an example word document with some text in it and it worked fine. Now with actual word documents that I need to parse that come in all types of formatting an...

VB.NET Array Arithmetic

Is there a built-in way to multiply every member of an array by some number in-place? Example: Dim volts () as Double = {1.243, 0.534, 5.343, 2.223, 4.334} Dim millivolts (4) as Double = volts.MultiplyEachBy(1000) 'something like this ...

What is a way to do a Generic Repository with Entity Framework 4.0 where I have function imports? (I don't want just a generic "execute" function where I pass in strings for the function name and parameters)

I have a generic repository that I communicate with my object context with. My object context has function imports that I want to be able to call through my generic repository. Currently I call them through an "Execute" function, but this is not ideal because I have to pass in my function name and parameters as strings which can cause r...

for loop for a string variable

this is my code - for i as integer = 0 to rows.count - 1 output &= "Name =" & row(i)("Name") output &= "lastName =" & row(i)("lastName") ... 50 more fields next i need the output to be like this Applicant1Name = MikeApplicant1lastName = ditkaApplicant2Name = TomApplicant2lastName = Brady ... how do i do this without putting th...

about combo box column of datagridview in vb.net

I have a standard DataGridView. One of the columns is aDataGridViewComboBoxColumn. When I select one of the ComboBox items, I wantto trap the change and add text in other column based on the data selected ...

Getting Insert statement Error, I cant figure out whats wrong though.

I am trying to insert into a DB with has the following columns: ID (autonumber), BonderIdentifier (text), Username (text), Login (date), Logout (date). BonderIdentifier, Username, Login is the PK. Here is what I do: Public Function submitNewToDB(ByVal sessionData As BonderSession) As Boolean Dim cn As OleDbConnection Dim cmd...

waveout sometimes memory issue

This code works to output a piano tone for 2 seconds using winmm.dll via platform invocation services, it seems to work fine on XP but waveoutopen fails in windows 7 rc updated based on feedback from John Knoeller Imports System.Runtime.InteropServices Public Class AudioStream <StructLayout(LayoutKind.Sequential)> _ Private Structure ...

Visual Studio 2008 Debug is launching my .NET WPF app with old source files

This started happening randomly yesterday. When I press F5 to test my project, an old build of the program (circa yesterday afternoon) launches. No changes (and I've tried in a few different files) are reflected in the project. However, and this is truly perplexing, if I go to Build --> Build from the Menu bar, the output .exe in the ...

Binding results of a sql query to listbox

I am getting stuck on this problem. It seems simple but for some reason im having trouble. Here is what I have of the following: Try cn = New OleDbConnection("Provider=microsoft.Jet.OLEDB.4.0;Data Source=G:\Sean\BMSBonder3_0.mdb;") cn.Open() str = "Select Distinct BonderIdentifier From [Session]" cmd ...

Remove duplicates from a List(Of T) in VB.NET

I fail to remove duplicates from my List. What am I doing wrong? Dim Contacts As New List(Of Person) ... ' remove duplicates ' Contacts = Contacts.Distinct(New PersonEqualityComparer).ToList my equality comparer: Public Class PersonEqualityComparer Implements IEqualityComparer(Of Person) Public Function Equals1(ByVal x As ...

Collection was modified; enumeration operation may not execute.

I cannot get to the bottom of this error because it happens only in one instance, and I can't find any code that can be the cause of the error. I have a 3.5 web service that I'm calling from a multi-threaded, CAB client. I have a bunch of unit tests against the web service (from both 3.5 and 2.0 code), and it works fine. However, in th...

visual studio forcing indentation

I am having a problem editing VB.NET .aspx pages in Visual Studio 2008. If I edit a line that is flush against the left margin, Studio automatically indents it 4 spaces, and there is no way to undo it! I am forced to save the file with that 1 line I edited indented differently than all the other lines! Edit: How do I turn this off? ...